Its very simple. On row data event You can add tooltip to a Cell.
Step1: Create a new Application:
Add a page name: gridTooltip
Step2: Add the following code inside the gridTooltip.aspx page:
<asp:gridview id="GridView1" runat="server" onrowdatabound="GridView1_RowDataBound" xmlns:asp="#unknown">
</asp:gridview>
Step3: Inside gridTooltip.aspx.cs page add the following code:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindGrid();
}
}
public class Data
{
public string Name
{
get;
set;
}
public int Age
{
get;
set;
}
}
public void BindGrid()
{
Data obj = new Data();
obj.Name = "Kabir";
obj.Age = 28;
Data obj1 = new Data();
obj1.Name = "Safiul";
obj1.Age = 28;
List<Data> olist = new List<Data>();
olist.Add(obj);
olist.Add(obj1);
GridView1.DataSource = olist;
GridView1.DataBind();
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Cells[0].ToolTip = "My Name is: " + e.Row.Cells[0].Text;
e.Row.Cells[1].ToolTip = "My age is: " + e.Row.Cells[1].Text;
}
}
---- Now run the application.
--- Hope it will help you
[Edit]Code blocks added[/Edit]