Thursday, February 3, 2011

How to create a ToopTip in gridview

Its very simple to create a tooltip in GridView

First,open the Default.aspx source page where we insert the gridview

Next,Just copy the following code from which you would like to display the tooltip



ToolTip='<%# Bind("Desgination") %>'
See the full code


<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
CellPadding="5" DataKeyNames="EmpID" ForeColor="#333333" GridLines="None" CellSpacing="5" >
<RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
<Columns>

<asp:TemplateField HeaderText="EmpName">

<ItemTemplate>

<asp:Label ID="lbl_empname" ToolTip='<%# Bind("Desgination") %>' runat="server" Text='<%# Bind("EmpName") %>'>>

</asp:Label>                      
                   
</ItemTemplate>

<EditItemTemplate>
<asp:TextBox ID="txt_empname" runat="server" Text='<%# Bind("EmpName") %>'>>

</asp:TextBox></EditItemTemplate>

</asp:TemplateField>

</Columns>

</asp:GridView>



That's it....
developercode
About the Author
Sayyad is a Software Engineer, Blogger and Founder of Developers Code from India.His articles mainly focus on .Net (Web and Windows based applications), Mobile Technologies (Android,IPhone,BlackBerry) and SEO.

Labels: , , , , , ,

3 Comments:

At April 25, 2011 at 7:57 PM , Anonymous Anonymous said...

Nice Tip...

 
At April 25, 2011 at 7:57 PM , Anonymous Anonymous said...

Thanks For Sharing..........

 
At June 28, 2011 at 10:17 AM , Anonymous Anonymous said...

Nice Tip...

 

Post a Comment

Subscribe to Post Comments [Atom]

<< Home