Skip to content

Commit 0a1eb14

Browse files
ES-975464 - Resolve ReadMe Length Issues in this Repository
1 parent d5c9b8b commit 0a1eb14

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

README.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
11
# how-to-bind-combobox-column-ItemsSource-from-view-model-in-wpf-and-uwp-treegrid-in-mvvm
22

3-
This example illustrates to bind the ComboBox column ItemsSource using MVVM.
3+
This example illustrates how to bind the ComboBox column's `ItemsSource` using MVVM in both [WPF TreeGrid](https://www.syncfusion.com/wpf-controls/treegrid) and [UWP TreeGrid](https://www.syncfusion.com/uwp-ui-controls/treegrid)
4+
5+
You can bind the `ItemsSource` from ViewModel to [TreeGridComboBoxColumn](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.TreeGrid.TreeGridComboBoxColumn.html) or using `ElementName` binding.
6+
7+
## XAML code:
8+
9+
``` xml
10+
<syncfusion:TreeGridComboBoxColumn AllowEditing="True"
11+
MappingName="Title"
12+
HeaderText="Title"
13+
ItemsSource="{Binding DataContext.TitleList,
14+
ElementName=treeGrid}" />
15+
```
16+
17+
## C# ViewModel:
18+
``` c#
19+
private ObservableCollection<string> titleList;
20+
public ObservableCollection<string> TitleList
21+
{
22+
get { return titleList; }
23+
set { titleList = value; }
24+
}
25+
```

0 commit comments

Comments
 (0)