Skip to content

Commit 056733e

Browse files
ES-975464 - Resolve the ReadMe issue in this sample repository
1 parent 6219fc6 commit 056733e

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

README.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,21 @@
1-
# How to change the itemssource of detailsview at runtime in winui datagrid?
2-
This example describes how to change the itemssource of detailsview at runtime in winui datagrid.
1+
# How to change the itemssource of detailsview at runtime in WinUI DataGrid
2+
3+
This example describes how to change the itemssource of detailsview at runtime in [WinUI DataGrid](https://www.syncfusion.com/winui-controls/datagrid) (SfDataGrid).
4+
5+
`ItemsSource` for `DetailsViewDataGrid` is populated from the DataContext of parent row based on [ViewDefinition.RelationalColumn](https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.DataGrid.ViewDefinition.html#Syncfusion_UI_Xaml_DataGrid_ViewDefinition_RelationalColumn). DetailsViewDataGrid doesn’t update its ItemsSource at runtime based on the property change, which is mapped the DetailsViewDataGrid ItemsSource. You can update the ItemsSource on the property change by setting [SfDataGrid.LiveDataUpdateMode](https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.DataGrid.SfDataGrid.html#Syncfusion_UI_Xaml_DataGrid_SfDataGrid_LiveDataUpdateMode) as `AllowChildViewUpdate`.
6+
7+
#### XAML
8+
9+
``` xml
10+
<dataGrid:SfDataGrid Name="dataGrid"
11+
AutoGenerateColumns="True"
12+
AutoGenerateRelations="True"
13+
GridLinesVisibility="Both"
14+
ItemsSource="{Binding Source}"
15+
LiveDataUpdateMode="AllowChildViewUpdate,AllowDataShaping">
16+
```
17+
#### C#
18+
19+
``` csharp
20+
this.dataGrid.LiveDataUpdateMode = LiveDataUpdateMode.AllowChildViewUpdate | LiveDataUpdateMode.AllowDataShaping;
21+
```

0 commit comments

Comments
 (0)