Skip to content

Commit ecf61fc

Browse files
ES-975464 - Changes committed
1 parent 0a1eb14 commit ecf61fc

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed
160 KB
Loading

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
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 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)
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).
44

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.
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.
66

7-
## XAML code:
7+
### XAML:
88

99
``` xml
1010
<syncfusion:TreeGridComboBoxColumn AllowEditing="True"
1111
MappingName="Title"
1212
HeaderText="Title"
1313
ItemsSource="{Binding DataContext.TitleList,
14-
ElementName=treeGrid}" />
14+
ElementName=treeGrid}" />
1515
```
1616

17-
## C# ViewModel:
17+
### C# ViewModel:
1818
``` c#
1919
private ObservableCollection<string> titleList;
2020
public ObservableCollection<string> TitleList
2121
{
2222
get { return titleList; }
2323
set { titleList = value; }
2424
}
25-
```
25+
```
26+
27+
![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)