This example illustrates to bind the Button command to ViewModel in WPF TreeGrid and UWP TreeGrid (SfTreeGrid).
You can load a button for the columns in TreeGrid using TreeGridTemplateColumn. When loading the buttons, you can bind a command in ViewModel using ElementName binding.
In the following example, ViewModel command receives the underlying data object as command parameter, since the DataContext is bound as command parameter.
<syncfusion:TreeGridTemplateColumn MappingName="Title"
syncfusion:FocusManagerHelper.WantsKeyInput="True">
<syncfusion:TreeGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button Content="Click" syncfusion:FocusManagerHelper.FocusedElement="True"
Command="{Binding Path=DataContext.RowDataCommand,ElementName=treeGrid}"
CommandParameter="{Binding}"/>
</DataTemplate>
</syncfusion:TreeGridTemplateColumn.CellTemplate>
</syncfusion:TreeGridTemplateColumn>