This problem was resolved... I am not sure what you meant by "thanks, but I was asking on the following lines." You have never posted on this thread before and I don’t see where
you are getting the code you mentioned from. If this is the wrong thread please open a new one, otherwise please provide more information about the problem you are having so someone can help.
I don't have time right now to write a code example but I would pursue using the TemplateField instead of the BoundField, it is much more flexible. If for some reason you need to use the BoundField you should be able to create your own BoundField control by
inheriting it, adding the properties you need, and then override the method that writes out the HTML.
Also, if you have never created your own control you should look up some tutorials. There is lots of great ones out there. You can have a look at
ASP.NET Real World Controls on CodePlex for a code example of extending the GridView control. Good luck!
Is there a way to add a class to expand the capability of BoundField to add tooltip? This is very unfortunate that some details have been left out by ms.
matanicht
Member
12 Points
6 Posts
Re: GridView headers with tooltips
Mar 07, 2008 07:59 PM|LINK
You can also use the following code with a LinkButton which will give you the ToolTip and allow sorting. Hope this helps.
<asp:GridView ID="GridView1" runat="server" AllowSorting="true" AutoGenerateColumns="false" DataSourceID="SqlDataSource1"> <Columns> <asp:TemplateField> <HeaderTemplate> <asp:LinkButton ID="LinkButton1" runat="server" ToolTip="ToolTip" CommandName="Sort" CommandArgument="SortExpressionHere" Text="Text" /> </HeaderTemplate> <ItemTemplate> <asp:Label ID="Label1" runat="server" Text='<%# Eval("DataColumn") %>' /> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView>kenbati
Member
234 Points
408 Posts
Re: GridView headers with tooltips
Jul 08, 2008 04:47 PM|LINK
nameBoundField.DataField = myDataField;
nameBoundField.SortExpression = mySortExpression;
nameBoundField.HeaderText = myHeaderText;
Our economy is bad due to corruption and monoply!
kenbati
Member
234 Points
408 Posts
Re: GridView headers with tooltips
Jul 08, 2008 09:31 PM|LINK
this problem is not resolved. pleae help
Our economy is bad due to corruption and monoply!
matanicht
Member
12 Points
6 Posts
Re: GridView headers with tooltips
Jul 08, 2008 10:36 PM|LINK
This problem was resolved... I am not sure what you meant by "thanks, but I was asking on the following lines." You have never posted on this thread before and I don’t see where you are getting the code you mentioned from. If this is the wrong thread please open a new one, otherwise please provide more information about the problem you are having so someone can help.
kenbati
Member
234 Points
408 Posts
Re: GridView headers with tooltips
Jul 09, 2008 03:52 AM|LINK
I am not sure I got into this thread but it showed up after I posed a similar question. In your thread the response is using the
<HeaderTemplate>
<asp:LinkButton ID="LinkButton1" runat="server" ToolTip="ToolTip" CommandName="Sort" CommandArgument="SortExpressionHere" Text="Text" />
</HeaderTemplate>
I am asking how to do the samething using the BoundField
BoundField nameBoundField = new BoundField();nameBoundField.DataField = myDataField;
nameBoundField.SortExpression = mySortExpression;
nameBoundField.HeaderText = myHeaderText;
Our economy is bad due to corruption and monoply!
matanicht
Member
12 Points
6 Posts
Re: GridView headers with tooltips
Jul 09, 2008 05:51 AM|LINK
Also, if you have never created your own control you should look up some tutorials. There is lots of great ones out there. You can have a look at ASP.NET Real World Controls on CodePlex for a code example of extending the GridView control. Good luck!
chandan.max
Participant
1402 Points
267 Posts
Re: GridView headers with tooltips
Jul 09, 2008 06:13 AM|LINK
Thanks for ur helpful resource....
Chandan,
Infogain.
kenbati
Member
234 Points
408 Posts
Re: GridView headers with tooltips
Jul 09, 2008 01:57 PM|LINK
thanks for the info,
Is there a way to add a class to expand the capability of BoundField to add tooltip? This is very unfortunate that some details have been left out by ms.
Our economy is bad due to corruption and monoply!
femin
Member
2 Points
1 Post
Re: GridView headers with tooltips
Nov 18, 2008 08:11 AM|LINK
{
e.Row.Cells[8].ToolTip = "Test Tooltip";}
}
kenbati
Member
234 Points
408 Posts
Re: GridView headers with tooltips
Nov 29, 2008 10:57 PM|LINK
No one seems to be helpful
Our economy is bad due to corruption and monoply!