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

Accessing DataKeyValues of DetailTable in standard Function

1 Answer 94 Views
Grid
This is a migrated thread and some comments may be shown as answers.
marbleblue
Top achievements
Rank 1
marbleblue asked on 09 Jun 2009, 08:53 AM
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.

 

<DetailTables> 
<telerik:GridTableView Name="gtv_account2" runat="server" DataKeyNames="InvoiceNumber, InvoiceDate, Outstanding">   
.  
<telerik:GridTemplateColumn UniqueName="gtv_account2_buttons">   
<ItemTemplate>   
<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">   
   
</telerik:RadToolTipManager> 

 


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!

 

 

 

1 Answer, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 11 Jun 2009, 02:50 PM
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,
Veli
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.
Tags
Grid
Asked by
marbleblue
Top achievements
Rank 1
Answers by
Veli
Telerik team
Share this question
or