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

RadGridView in RowDetailsTemplate

1 Answer 178 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Rouf asked on 10 Jun 2019, 02:48 PM

My RadGridView is binded to a List of  (say) Samples. In RowDetailsTemplate I want to show another RadGridView which will show the related records from the List (say) Analysis. The main RadGridView GrdSamples is bound in Codebehind as :



How can I bind the Child GridView GrdAnalysis in the same way. And on which event I will get the GrdSamples ID, So that I can use Some thing like

var SampleID = ? 

Here is the XAML

<telerik:RadGridView x:Name="GrdSamples" AutoGenerateColumns="False">
                   <telerik:RadGridView x:Name="GrdAnalysis" AutoGenerateColumns="False">



1 Answer, 1 is accepted

Sort by
Vladimir Stoyanov
Telerik team
answered on 11 Jun 2019, 10:27 AM
Hello Rouf,

Thank you for the provided code snippets. 

In order to achieve what you are going for you can utilize the RowDetailsVisibilityChanged event. In that event you have access to the object bound to that row and also the details element. Here is some sample code:
private void gridView_RowDetailsVisibilityChanged(object sender, Telerik.Windows.Controls.GridView.GridViewRowDetailsEventArgs e)
            // you can get the sample id from that object
            var object = e.Row.Item;
            (e.DetailsElement as RadGridView).ItemsSource = // Get items for child grid

I hope you find this helpful. 

Vladimir Stoyanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Asked by
Top achievements
Rank 1
Answers by
Vladimir Stoyanov
Telerik team
Share this question