<ig:XamGrid x:Name="dataGrid" ActiveItem="{Binding Path=ActiveCustomer, Mode=TwoWay}" ItemsSource="{Binding Path=Customers}" >
We recommend that you use the xamDataGrid control instead of the xamGrid control. The xamGrid is being planned for retirement over the next few years and will not receive any new features. We will continue to provide support and critical bug fixes for the xamGrid during this time. For help or questions on migrating your codebase to the xamDataGrid, please contact support.
While using the Model-View-ViewModel (MVVM) architecture, the xamGrid control’s ActiveItem property allows you to easily access the data item in the root-level ColumnLayout.
To enable this feature, create a Binding to the xamGrid control’s ActiveItem property, as demonstrated in the following code snippet:
In XAML:
<ig:XamGrid x:Name="dataGrid" ActiveItem="{Binding Path=ActiveCustomer, Mode=TwoWay}" ItemsSource="{Binding Path=Customers}" >
Based on the above code snippet:
If the ActiveCell changes rows, the ActiveCustomer property on the ViewModel will update.
If the ActiveCustomer property is changed, the grid will try to resolve it and set the ActiveCell to the first visual cell in that row.