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

Access Column of a RadGrid header?

1 Answer 168 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Gene
Top achievements
Rank 1
Gene asked on 17 Apr 2009, 03:38 PM
Hello,

Perhaps I'm not going about this the right way, but here is my scenario:

I have a radgrid and a radtooltipmanager.  I use the ItemCreated event on the radgrid to add each of the headers of the radgrid to the target controls of the radtooltipmanager (using examples I've seen on this site:

Protected Sub _assignedRefsRadGrid_ItemCreated(ByVal sender As ObjectByVal e As Telerik.Web.UI.GridItemEventArgs) Handles _assignedRefsRadGrid.ItemCreated 
        If (TypeOf e.Item Is GridHeaderItem) Then 
            Dim headerItem As GridHeaderItem = e.Item 
            For Each column As GridColumn In _assignedRefsRadGrid.MasterTableView.RenderColumns 
                If ((Not TypeOf column Is GridExpandColumn) And (Not TypeOf column Is GridRowIndicatorColumn)) Then 
                    Dim hdr As LinkButton = headerItem(column.UniqueName).Controls(0) 
                    RadToolTipManager1.TargetControls.Add(hdr.ClientID, True
                End If 
            Next 
        End If 
    End Sub 

So now, when the user hovers over a header, I want to grab some help content from an XML file and place it in the resulting tooltip.  So, I am using the AjaxUpdate event of the RadToolTipManager.  However, I would like to use the UniqueName of the column on which the user hovered in order to grab the content from the XML file.  I am at a loss as to how to access the column in which the LinkButton that the user is hovering over appears.  Any suggestions?

Thanks,
Gene


1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 20 Apr 2009, 08:25 AM
Hi Gene,

Try the following code snippet in the client OnColumnMouseOver event to access the UniqueName of the column.

ASPX:
 
  <ClientEvents OnColumnMouseOver="MouseHover"  /> 

JS:
 
<script type="text/javascript" > 
 function MouseHover(sender, eventArgs) 
 { 
 alert(eventArgs.get_gridColumn().get_uniqueName()); 
 } 
  
</script> 


Shinu
Tags
Grid
Asked by
Gene
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or