Hi,
I'm new in WPF and I would like to know is possible to display in a RadGridView the headers with their details?
I have two DataTable which the first keep the header values and the second Datatable keeps the details values from a database. I'm able to display the header values in the RadGridview but I couldn't find how to display their details for each header.
For Example:
The RadGridView shows the Sales Number, Sales date and total then when the user clicks in the Sales number row it displays the Sales details with all the products and their descriptions.
I would appreciate your help or any suggestions.
Regards,
Oscar
4 Answers, 1 is accepted
Though I am not sure I understand your requirements thoroughly enough, I believe you are trying to implement some type of hierarchical RadGridView or show additional information about each row within the grid control. If this is the case, I suggest you check the following article from our documentation to find out more information on the how to show additional details of the row
- RadGridView - RowDetails Template
I suggest you also check the "Expand/Collapse Row Details" and "Row Details Template Selector" demos from our SDK Samples Browser.
Regards,
Stefan Nenchev
Telerik by Progress
Hi Stefan Nenchev,
Thanks for your advice, I'm checking the topics but I didn't make it. I used the RadGridView.ChildTableDefinitions to try to relation both datatables but those are not displayed in my RadGridView, this is the xaml code that I used:
<telerik:RadGridView x:Name="radgridview1" ValidatesOnDataErrors="InEditMode" Grid.Row="0" ShowGroupPanel="False" IsReadOnly="True"
AutoGenerateColumns="False"
DataMember="HeaderValues" ItemsSource="{Binding HeaderValues}" >
<telerik:RadGridView.ChildTableDefinitions>
<telerik:GridViewTableDefinition />
</telerik:RadGridView.ChildTableDefinitions>
<telerik:RadGridView.HierarchyChildTemplate>
<DataTemplate>
<telerik:RadGridView Name="radgridview1" AutoGenerateColumns="False" DataMember="DetailValues" ItemsSource="{Binding DetailValues}" ></telerik:RadGridView>
</DataTemplate>
</telerik:RadGridView.HierarchyChildTemplate>
</telerik:RadGridView>
HeaderValues and DetailValues are the DataTable that are filled from a connection to SQL
have I made something wrong?
Thansk for your help and suggestions
Oscar
It seems that you have made a mix of both approaches available for setting up a hierarchical grid. I have added a sample project that shows a hierarchical RadGridView bound to a DataTable. Please review it and consider such approach from your end.
Regards,
Stefan Nenchev
Telerik by Progress
Hi Stefan Nenchev,
I reviewed your example, this was a a lot of help for me. Now is working fine.
thanks a lot of
Regards,
Oscar Hernandez