Hi,
I have a radgrid. I am binding data to radgrid on server side and in ItemDataBound event I am manipulating each cell in each row assigning text and tooltip to it. I am also creating columns programmatically beforehand. Everything works fine until I reorder any column on client side. After reordering tooltip that is shown is of item which was initially at that position and same for alignment. So can you please help me out in setting alignment and tooltip?
Thanks,
mahesh
I have a radgrid. I am binding data to radgrid on server side and in ItemDataBound event I am manipulating each cell in each row assigning text and tooltip to it. I am also creating columns programmatically beforehand. Everything works fine until I reorder any column on client side. After reordering tooltip that is shown is of item which was initially at that position and same for alignment. So can you please help me out in setting alignment and tooltip?
Thanks,
mahesh
8 Answers, 1 is accepted
0

Shinu
Top achievements
Rank 2
answered on 06 Feb 2012, 11:59 AM
Hello Mahesh,
Check the following forum thread which discussed similar scenario.
tooltip and ragrid column reordering
-Shinu.
Check the following forum thread which discussed similar scenario.
tooltip and ragrid column reordering
-Shinu.
0

Rashmi
Top achievements
Rank 1
answered on 06 Feb 2012, 12:09 PM
Hi,
I don't wish to have server side reordering. So solution will not work for me. Is there any solution where I can show tooltip on mouse hover on each particular cell using Javascript?
I don't wish to have server side reordering. So solution will not work for me. Is there any solution where I can show tooltip on mouse hover on each particular cell using Javascript?
0
You can take an alternative approach in this case. Instead of setting tooltip to the grid table cells, use a label or another control inside your cells and set a tooltip to that label. Thus, when RadGrid columns are reordered on the client, your labels will get swapped along with the tooltips.
Veli
the Telerik team
Veli
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0

Rashmi
Top achievements
Rank 1
answered on 13 Feb 2012, 09:25 AM
Hi Veli,
Can you elaborate on this more or provide some sample code?
Thanks,
Mahesh
Can you elaborate on this more or provide some sample code?
Thanks,
Mahesh
0
Hi Mahesh,
You can have a GridTemplateColumn with a Label control in the ItemTemplate:
The content of the Label is bound to the ID field using a binding expression. You can set the Tooltip to the label control. Thus, when your cells are reordered, the labels will get swapped along with their respective tooltips.
Veli
the Telerik team
You can have a GridTemplateColumn with a Label control in the ItemTemplate:
<
telerik:GridTemplateColumn
>
<
ItemTemplate
>
<
asp:Label
ID
=
"Label1"
runat
=
"server"
ToolTip
=
"TOOLTIP FOR FIELD ID"
>
<%# Eval("ID") %>
</
asp:Label
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
The content of the Label is bound to the ID field using a binding expression. You can set the Tooltip to the label control. Thus, when your cells are reordered, the labels will get swapped along with their respective tooltips.
Veli
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0

Rashmi
Top achievements
Rank 1
answered on 14 Feb 2012, 01:38 PM
Hi,
I am not using GridTemplateColumn but GridBoundColumn and GridImageColumn. So your solution will not work for me. Can you provide with some other workaround? Thanks for your efforts.
Regards,
Mahesh
I am not using GridTemplateColumn but GridBoundColumn and GridImageColumn. So your solution will not work for me. Can you provide with some other workaround? Thanks for your efforts.
Regards,
Mahesh
0
Accepted
Hello Mahesh,
For GridBoundColumns, you can use the DataFormatString property to wrap the contents of your cell in a <span> element with the requiored tooltip:
Using this trick, your table cells will contain <span> elements with a tooltip and these will get swapped when reordering columns.
There is no workaround we can suggest for the GridImageColumn.
Veli
the Telerik team
For GridBoundColumns, you can use the DataFormatString property to wrap the contents of your cell in a <span> element with the requiored tooltip:
<
telerik:GridBoundColumn
DataField
=
"ID"
HeaderText
=
"ID"
UniqueName
=
"ID"
DataFormatString="<span
style
=
'display:block'
title
=
'Tooltip for ID column'
>{0}</
span
>" />
Using this trick, your table cells will contain <span> elements with a tooltip and these will get swapped when reordering columns.
There is no workaround we can suggest for the GridImageColumn.
Veli
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0

Rashmi
Top achievements
Rank 1
answered on 15 Feb 2012, 08:30 AM
Thanks a lot..that solved my problem.
Regards,
Mahesh
Regards,
Mahesh