Skip to content

Commit f50e58d

Browse files
authored
Merge pull request #4 from SyncfusionExamples/ES-975464
ES-975464 - Resolve the ReadMe issue in this sample repository
2 parents ba7bad2 + 9f3e4ab commit f50e58d

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed
81.7 KB
Loading

README.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,19 @@
1-
# how-to-generate-the-two-level-detailsviewdatagrid-with-datatable-collection-in-winforms-datagrid
2-
How to generate the two level DetailsViewDataGrid with DataTable collection in WinForms DataGrid(SfDataGrid)?
1+
# How to Generate the Two Level DetailsViewDataGrid with DataTable Collection in WinForms DataGrid?
2+
3+
This sample illustrates how to generate the two level `DetailsViewDataGrid` with `DataTable` collection in [WinForms DataGrid](https://www.syncfusion.com/winforms-ui-controls/datagrid) (SfDataGrid).
4+
5+
By default, the `DetailsView` will be added for single relation when the `AutoGenerateRelations` is enabled. To add multiple related tables in `DataGrid`, `AutoGenerateRelations` for each grid can be enabled through [SfDataGrid.AutoGeneratingRelations](https://help.syncfusion.com/cr/windowsforms/Syncfusion.WinForms.DataGrid.SfDataGrid.html#Syncfusion_WinForms_DataGrid_SfDataGrid_AutoGeneratingRelations) event.
6+
7+
``` csharp
8+
//Event subscription
9+
this.sfDataGrid1.AutoGeneratingRelations += new Syncfusion.WinForms.DataGrid.Events.AutoGeneratingRelationsEventHandler(SfDataGrid1_AutoGeneratingRelations);
10+
11+
//Event customization
12+
private void SfDataGrid1_AutoGeneratingRelations(object sender, Syncfusion.WinForms.DataGrid.Events.AutoGeneratingRelationsEventArgs e)
13+
{
14+
//To enable AutoGenerateColumns for child grid.
15+
e.GridViewDefinition.DataGrid.AutoGenerateRelations = true;
16+
}
17+
```
18+
19+
![DataGrid with two level of DetailsViewDataGrid bound with DataTable](DetailsViewDataGridWithDataTable.png)

0 commit comments

Comments
 (0)