Version

Active Item

Please note that this control has been retired and is now obsolete to the XamDataGrid control, and as such, we recommend migrating to that control. It will not be receiving any new features, bug fixes, or support going forward. 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.

Note
Note:

The ActiveItem feature only affects the root level ColumnLayout. If a cell in a child ColumnLayout is activated, then the ActiveItem will be set to null.