Reputation: 4137
how to set tool tip for each cell of a devexpress gridview in asp.net & c#.net
Upvotes: 0
Views: 7634
Reputation: 151
Same concept as mhughes but in my case the gridView is dynamically created so I had to add the event handler after the fact.
_gridview.HtmlDataCellPrepared += new ASPxGridViewTableDataCellEventHandler(_gridview_HtmlDataCellPrepared);
void _gridview_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
{
if (e.CellValue != null)
e.Cell.Attributes.Add("title", e.CellValue.ToString());
}
Upvotes: 0
Reputation: 2476
First, set the "OnHtmlDataCellPrepared" property of your grid, like this:
<dx:ASPxGridView ID="ASPxGridView1" runat="server"
OnHtmlDataCellPrepared="ASPxGridView1_HtmlDataCellPrepared">
</dx:ASPxGridView>
Then set the "title" attribute of the cells in your codebehind:
protected void ASPxGridView1_HtmlDataCellPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableDataCellEventArgs e)
{
e.Cell.Attributes.Add("title", "Your Tooltip");
}
Upvotes: 2