Tooltip in RadGrid

2 posts, 0 answers
  1. Tony Deo
    Tony Deo avatar
    3 posts
    Member since:
    Sep 2009

    Posted 20 Nov 2009 Link to this post

    Hi, I have a tooltip in a templated column within my radgrid.  I am trying to programmatically change the text on the tooltip depending upon a session variable.

    However, I cannot seem to find the tooltip when I call it up in code.

    Can anyone help.

    I have posted my code.
    <telerik:GridTemplateColumn UniqueName="TemplateColumn">  
                    <asp:Button runat="server" CommandName="Update" Text="Update" /> 
                    &nbsp;<asp:Button runat="server" CausesValidation="false" CommandName="Cancel"   
                        Text="Cancel" /> 
                    <asp:ImageButton ID="ibPrint" runat="server" ImageUrl="~/Images/print2.jpg"   
                        CausesValidation="false" CommandName="Edit" BackColor="White" /> 
                    <telerik:RadToolTip ID="ttibPrint" runat="server" TargetControlID="ibPrint" Text="print"</telerik:RadToolTip> 
                <ItemStyle BackColor="White" HorizontalAlign="Center" /> 
     If Session("UserCulture") = 2 Then 
                If TypeOf e.Item Is GridDataItem Then 
                    Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)  
                    Dim editBtn1 As RadToolTip = TryCast(item("TemplateColumn1").Controls(1), RadToolTip)  
                    Dim editBtn3 As RadToolTip = TryCast(item("TemplateColumn").Controls(1), RadToolTip)  
                    editBtn1.Text = "视图采购申请" 
                    editBtn3.Text = "打印" 
                End If 
            End If 
  2. Svetlina Anati
    Svetlina Anati avatar
    2795 posts

    Posted 24 Nov 2009 Link to this post

    Hi Tony Deo,

    Since the grid item is an Inaming Conatiner you should use it as such and find the tooltip by uisng the FindControl method in similar manner as this:


    Note, also that you do not need the GridDataItem, but you should use the following condition:

    If e.Item.ItemType = GridItemType.Item OrElse e.Item.ItemType = GridItemType.AlternatingItem

    All the best,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top