After swapping columns, the tooltip still shows in the old column position.
I set the tooltip in:
RadGrid1_ItemDataBound
using:
((TableCell)e.Item.Cells[12]).ToolTip= "something";
The problem is when the user swaps(moves) that column (lets say column number 12 with column number 14), then the tooltip doesn't move(migrate) with the column. The tooltip will show (when the user hovers the cursor) in the wrong column (column 12) instead of the new position (14).
Is there a way to make the tooltip show in the new column position?
Thank you.
6 Answers, 1 is accepted
Try to set the ToolTip for the cell using the UniqueName Property. Because of features such as column reordering and grouping, the index of individual columns can change on the client. This means that using indexes to access individual cells in the Cells collection of a row is not a reliable method of obtaining a cell in a particular column.
To provide a reliable way of locating the cell in a particular column, each column in the grid has a UniqueName property of type string. Using the UniqueName property of a column lets you reliably locate a column even when its index changes.
You can also refer the following help articles.
Adding tooltips for grid items
Accessing cells and rows
Hope this helps..
Shinu.
Thank you for your reply. I did change it to use the column unique name, but when I move the column the tooltip will not show in the new position, instead it will still show in the column old position.
The column move is a client event, do I need to force it to run RadGrid_ItemBound in the server code to re-asign the tooltip every time I do a column move(or swap)?
This is the code:
protected void RadGrid1_ItemDataBound(object sender, Telerik.WebControls.GridItemEventArgs e)
{
if(e.Item is GridDataItem)
{
if (e.Item != null)
{
GridDataItem gridItem = (GridDataItem)e.Item;
if(!(gridItem["RouteNote"].Text.Equals(" ")))
{
gridItem["CountRouteNotes"].ToolTip = gridItem["RouteNote"].Text;
}
else
{
gridItem["CountRouteNotes"].ToolTip = " ";
}
}
}
}
Kiara
Same with the tooltips, if A has a tooltip and B has no tooltip. After you swap column A with B, column A will still have the tooltip and B no tooltip. Instead of moving the tooltip to column B.
Do you know when this will be fixed in the RadGrid? Is there a new version coming?
Thank you,
PG.
We will add fix for this in our second service pack (we just released our first service pack). I have added 1000 Telerik points to your account.
Best wishes,
Vlad
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Thank you for the reply and thanks for the points.
Pablo