Thursday, September 3, 2015

ASP.NET Show Tooltip in Gridview Column

Here's how to show tooltip in an asp.net gridview column/cell on mouse hover. This option will set the Tooltip property of a particular gridview cell on RowDataBound event.

C# Code:
1
2
3
4
5
6
7
8
protected void grdCustomers_RowDataBound(object sender, GridViewRowEventArgs e)
{
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            string str = e.Row.Cells[1].Text;
            e.Row.Cells[1].ToolTip = str;
        }
}

0 comments:

Post a Comment