From f248b6fb88357c5310f73c0d3f9eaca999dc964d Mon Sep 17 00:00:00 2001 From: Sreemon Premkumar M Date: Thu, 14 Aug 2025 13:37:17 +0530 Subject: [PATCH] ES-975464 - Resolve ReadMe length Issues in this Repository --- README.md | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1d32837..7cec4b9 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,42 @@ # how-to-bind-the-SelectedItem-property-of-wpf-tree-grid-in-mvvm -This example illustrates to bind the SelectedItem property from ViewModel to treegrid. \ No newline at end of file +This example illustrates to bind the `SelectedItem` property from ViewModel to the [SelectedItem](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_SelectedItem) Property of [WPF TreeGrid](https://www.syncfusion.com/wpf-controls/treegrid) and [UWP TreeGrid](https://www.syncfusion.com/uwp-ui-controls/treegrid). + +You can bind the `SelectedItem` property directly to `TreeGrid` by setting the [SfTreeGrid.SelectedItem](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_SelectedItem) property. + +## XAML code: + +``` xml + + +``` + +## C# code: + +``` C# +public class ViewModel: NotificationObject +{ + private object selectedItem; + public object SelectedItem + { + get + { + return selectedItem; + } + set + { + selectedItem = value; + RaisePropertyChanged("SelectedItem"); + } + } +} +``` \ No newline at end of file