Skip to content

Commit 1edbccd

Browse files
ES-975464 - Resolve Issues ReadMe length issue in this repository
1 parent 2334cab commit 1edbccd

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
11
# how-to-bind-view-model-ItemsSource-to-combo-box-inside-template-in-wpf-and-uwp-treegrid-in-mvvm
22

3-
This example illustrates to bind the ComBox ItemsSource that is loaded inside the template column.
3+
This example illustrates to bind the ComboBox `ItemsSource` that is loaded inside the template column.
4+
5+
You can load a ComboBox inside [TreeGridTemplateColumn](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.TreeGrid.TreeGridTemplateColumn.html) and bind the `ItemsSource` from ViewModel to ComboBox using `ElementName` binding.
6+
7+
```xml
8+
<syncfusion:TreeGridTemplateColumn MappingName="Title" syncfusion:FocusManagerHelper.WantsKeyInput="True">
9+
<syncfusion:TreeGridTemplateColumn.CellTemplate>
10+
<DataTemplate>
11+
<TextBlock Text="{Binding Title}"/>
12+
</DataTemplate>
13+
</syncfusion:TreeGridTemplateColumn.CellTemplate>
14+
<syncfusion:TreeGridTemplateColumn.EditTemplate>
15+
<DataTemplate>
16+
<ComboBox ItemsSource="{Binding Path=DataContext.TitleList, ElementName=treeGrid}" />
17+
</DataTemplate>
18+
</syncfusion:TreeGridTemplateColumn.EditTemplate>
19+
</syncfusion:TreeGridTemplateColumn>
20+
```

0 commit comments

Comments
 (0)