I am using a RadGrid. There is a column called Comments where I currently have it as Y/N
I like to add a tool tip if they hover over the Comments header rows. Is there a easy way of doing this? For a column called CommentsY/N I have values of Y/N. I also have a column called Comments which I am hiding. When the user hovers over CommentsY/N, I like to show the Comments field value.
What I have so far is the following:
What I am trying to do is to hover over the Notes column row and then display the Comments which is also a bound column on the grid. As the comments can be quite lengthy I want to show it when the user hovers over the Notes. Once the hover works, I will make the Comments field not visible.
Here is what I have but the thing is that when I hover over the Notes, I only see it say Cmmts and it doesn’t display the content of the Comments for a given row.
if (e.Item is GridDataItem)
{
GridDataItem gridItem = e.Item as GridDataItem;
foreach (Telerik.Web.UI.GridColumn column in WtrClients.MasterTableView.RenderColumns)
{
if (column is GridBoundColumn)
{
//this line will show a tooltip based on the CustomerID data field
if (column.UniqueName == "Notes")
{
gridItem[column.UniqueName].ToolTip = "Cmmts:" +
Convert.ToString(gridItem.OwnerTableView.DataKeyValues[gridItem.ItemIndex]["Comments"]);
}
}
}
}
You could do an
Label ItemTemplatein the grid, evaluate whether there is anything in your comments to display aYorNand then set the tooltip. :