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

Handle to Tooltip inside RadGrid

1 Answer 94 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Viz
Top achievements
Rank 1
Viz asked on 26 Mar 2011, 02:20 AM
I have a RadGrid that is bound on the client-side. It contains a GridTemplateColumn with a label and a tooltip.
Because it's bound on the client i can only assume that I would need to dyanmically set the tooltip text there as well.  My issue is that I cannot get the handle of the tooltip in the OnRowDataBound event.  ...Possibly because it lies within the RadGrid.  Any ideas on how to accomplish this?

The GridTemplatecolumn:

 

<telerik:GridTemplateColumn DataField="dataf1" HeaderText="myheading1" UniqueName="dataf1">

 

 

<ItemTemplate>

 

 

<asp:Label ID="Label1" runat="server" Text='hover'>

 

 

</asp:Label>

 

 

<telerik:RadToolTip ID="RadToolTip1" runat="server" TargetControlID="Label1" Width="150px"

 

 

RelativeTo="Element" Position="MiddleRight" EnableShadow="true">

 

</telerik:RadToolTip>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 


handle to tooltip is null

 

 

 

 

function OnRowDataBound(sender, args)

 

 

{

 

 

 var tooltip = $find("RadToolTip1");
tooltip.set_text = "something new here";        //this is null!
}

1 Answer, 1 is accepted

Sort by
0
Viz
Top achievements
Rank 1
answered on 27 Mar 2011, 07:59 PM
SOLVED:

I resolved this by

                var rtooltip = args.get_item().findControl("RadToolTip1");
                if (rtooltip != null)
                {
                    rtooltip.set_text('some text');
                }

*NOTE:  you need to check for null because there is a bug in the client-side binding with a GridTemplateColumn and the control not showing past 10 or 11 rows:
http://www.telerik.com/community/forums/aspnet-ajax/grid/gridtemplatecolumn-problem-on-page-resize.aspx
Tags
Grid
Asked by
Viz
Top achievements
Rank 1
Answers by
Viz
Top achievements
Rank 1
Share this question
or