Accessing DataKeyValues of DetailTable in standard Function

2 posts, 0 answers
  1. marbleblue
    marbleblue avatar
    12 posts
    Member since:
    Apr 2008

    Posted 09 Jun 2009 Link to this post

    I have 3 levels of details tables within a rad grid.

    The bottom details table contains a GridTemplateColumn with an image button which is linked to a RadToolTipManager.

    On click, a Modal tooltip is displayed, but I need to access the datakeyvalues of the grid to send values to the Tooltip.

    I can do this easily at a top level RadGrid table, but I cant seem to do it from a details table.


    <telerik:GridTableView Name="gtv_account2" runat="server" DataKeyNames="InvoiceNumber, InvoiceDate, Outstanding">   
    <telerik:GridTemplateColumn UniqueName="gtv_account2_buttons">   
    <asp:ImageButton ID="Invoice_Query" CommandName="Invoice_Query" ImageUrl="~/Images/Icons/invoice_query.gif" runat="server" AlternateText="Click to query invoice" CausesValidation="false" />   
    <telerik:RadToolTipManager ID="RadToolTipManager_Query_Invoice" HideEvent="ManualClose" Modal="true" runat="server" OnAjaxUpdate="OnAjaxUpdate_Query_Invoice" RelativeTo="BrowserWindow">   


    Clicking the image button launches the tooltip, and the function in the definition above it hit (OnAjaxUpdate_Query_Invoice).

    How can I access the datakeyvalues in the following function?  


    Protected Sub OnAjaxUpdate_Query_Invoice(ByVal sender As ObjectByVal args As ToolTipUpdateEventArgs)  
    End Sub 

    The following didn't work:

    value = RadGrid1.MasterTableView.DetailTables(0).DataKeyValues(args.Value)("InvoiceNumber") 

    Thanks for any help!




  2. Veli
    Veli avatar
    2002 posts

    Posted 11 Jun 2009 Link to this post

    Hello Kushel,

    Try the following approach in RadToolTipManager's OnAjaxUpdate event:

    ((Page.FindControl(args.TargetControlID) as ImageButton).NamingContainer as GridDataItem).OwnerTableView.DataKeyValues(0); 

    This is, try to reference the ImageButton from inside the event. Once you reference the button, its NamingContainer is a reference to the parent GridDataItem from which you can access the OwnerTableView and its DataKeyValues.

    Kind regards,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top