Introduction:
In this article i am going to demonstrate how to display a particular gridview row value as tooltip using asp.net/c#.
Main:
Tooltip’s are very helpful to display the necessary details in very simple manner,
To achieve the above functionality i used the below simple code,
protected void gridviewtooltip_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.ToolTip = "Department Details: " +
Convert.ToString(DataBinder.Eval(e.Row.DataItem,
"deptname"));
e.Row.Style.Add("Cursor", "Hand");
}
}
protected void gridviewtooltip_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.ToolTip = "Department Details: " + Convert.ToString(DataBinder.Eval(e.Row.DataItem, "deptname")); e.Row.Style.Add("Cursor", "Hand"); } } |
Conclusion:
Hope this helps,
Happy Coding.

1 Comments.