This is a migrated thread and some comments may be shown as answers.

column(cell) tooltip showing in wrong position after swap

6 Answers 194 Views
Grid
This is a migrated thread and some comments may be shown as answers.
PG
Top achievements
Rank 1
PG asked on 01 May 2008, 08:32 PM
Since Bulgaria is in holiday I'm also sending this question (from a support ticket) to this forum.

 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.

= "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

Sort by
0
Shinu
Top achievements
Rank 2
answered on 02 May 2008, 04:25 AM
Hi,

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.
0
PG
Top achievements
Rank 1
answered on 02 May 2008, 02:33 PM
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 = " ";
}
}
}
}



0
Kiara
Top achievements
Rank 1
answered on 04 May 2008, 01:01 PM
Check whether setting ClientSettings -> ReorderColumnsOnClient = false addresses the issue with the wrong tooltip position after column reorder/swap. To simulate client performance ajax-enable the grid with RadAjaxManager or RadAjaxPanel.

Kiara
0
PG
Top achievements
Rank 1
answered on 16 May 2008, 09:02 PM
From what I'm reading in your web site, the settings for the columns don't get moved when the user moves(swaps) columns in the client side (without re-binding). For example, if column A has a header aligned to the left, and column B has its header aligned to the right. If you swap on the client side (without re-binding) the grid, then the header for column A will still be aligned to the left and column B's header will still be aligned to the right.

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.
0
Vlad
Telerik team
answered on 17 May 2008, 01:32 PM
Hello 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
0
PG
Top achievements
Rank 1
answered on 19 May 2008, 01:35 PM
Vlad,

Thank you for the reply and thanks for the points.

Pablo
Tags
Grid
Asked by
PG
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
PG
Top achievements
Rank 1
Kiara
Top achievements
Rank 1
Vlad
Telerik team
Share this question
or