Skip to content

Commit 4a10179

Browse files
authored
Merge pull request #2 from SyncfusionExamples/ES-975464
ES-975464 - Resolve ReadMe Length Issues in this Repository
2 parents ddf9abf + 37d5ce0 commit 4a10179

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed
160 KB
Loading

README.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
1-
# how-to-bind-combobox-column-ItemsSource-from-view-model-in-wpf-and-uwp-treegrid-in-mvvm
1+
# How to Bind Column ItemsSource from ViewModel in WPF / 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 [WPF TreeGrid](https://www.syncfusion.com/wpf-controls/treegrid) / [UWP TreeGrid](https://www.syncfusion.com/uwp-ui-controls/treegrid) (SfTreeGrid).
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:
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+
21+
public ObservableCollection<string> TitleList
22+
{
23+
get { return titleList; }
24+
set { titleList = value; }
25+
}
26+
```
27+
28+
![How to Bind Column ItemsSource from ViewModel in WPF / UWP TreeGrid in MVVM](Bind_combobox_column_ItemsSource_from_view_model.png)

0 commit comments

Comments
 (0)