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

[Solved] Adding a tooltip - not so easy?

1 Answer 135 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Clive Hoggar
Top achievements
Rank 1
Clive Hoggar asked on 26 Aug 2009, 11:58 AM
Hi guys

Thanks for all your help so far!

Following the help docs I have added this in code behind to add a very simple tooltip
to my grid which should show the record ID on mouseover.

Protected Sub RadGrid1_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs)  
         
        If (TypeOf e.Item Is GridDataItem) Then  
            Dim gridItem As GridDataItem = CType(e.Item, GridDataItem)  
 
            For Each column As GridColumn In RadGrid1.MasterTableView.RenderColumns  
                If (TypeOf column Is GridBoundColumn) Then  
 
                    gridItem(column.UniqueName).ToolTip = ("ID: " + gridItem.OwnerTableView.DataKeyValues(gridItem.ItemIndex)("ID").ToString)  
                      
                End If  
            Next  
        End If  
    End Sub 

This doesn't actually do anything - no hand appears on mousover, no tooltip.

Do I also need RadAjax Manger and Tooltip manager in the declarations? The docs don't mention it but
the demo shows them so added this as my grid has paging and sorting  (I already have radajaxmanager in master page):
<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">  
                    <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="RadGrid1">  
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                        <telerik:AjaxUpdatedControl ControlID="RadToolTipManager1" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
            </AjaxSettings> 
                    </telerik:RadAjaxManagerProxy> 
                  
                <telerik:RadToolTipManager ID="RadToolTipManager1" runat="server"   
                        ManualClose="True">  
                    </telerik:RadToolTipManager> 

Still haven't succeeded.   Maybe some 'imports'missing in code behind? 

Can you suggest where I am going wrong?

Thanks

Clive

1 Answer, 1 is accepted

Sort by
0
Schlurk
Top achievements
Rank 2
answered on 26 Aug 2009, 05:02 PM
From what I can tell your code does "tooltipify" your grid, however that is all that it does. Basically you create the tooltips for grid items but you never try to show them. You also never interact with the tooltipmanager which is also important for actually maintaining and displaying your tooltips.

I say take another look at the demo that I assumed you based this off of. Hopefully looking into it more (the function you posted is similar in structure to the one in the demo, except you don't do anything with the tooltipmanager) will help you out!
Tags
Grid
Asked by
Clive Hoggar
Top achievements
Rank 1
Answers by
Schlurk
Top achievements
Rank 2
Share this question
or