Skip to content

SyncfusionExamples/how-to-bind-combobox-column-ItemsSource-from-view-model-in-wpf-and-uwp-treegrid-in-mvvm

Repository files navigation

How to Bind Column ItemsSource from ViewModel in WPF / UWP TreeGrid in MVVM?

This example illustrates how to bind the ComboBox column's ItemsSource using MVVM in WPF TreeGrid / UWP TreeGrid (SfTreeGrid).

You can bind the ItemsSource from ViewModel to TreeGridComboBoxColumn or using ElementName binding.

XAML:

<syncfusion:TreeGridComboBoxColumn AllowEditing="True" 
                                   MappingName="Title"
                                   HeaderText="Title"
                                   ItemsSource="{Binding DataContext.TitleList,
                                                ElementName=treeGrid}" />

C# ViewModel:

private ObservableCollection<string> titleList;

public ObservableCollection<string> TitleList
{
     get { return titleList; }
     set { titleList = value; }
}

How to Bind Column ItemsSource from ViewModel in WPF / UWP TreeGrid in MVVM

About

This example illustrates to bind the WPF TreeGrid ComboBox column ItemsSource using MVVM.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5

Languages