Version

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.

Changing Cell Values in Code Behind

The xamGrid™ control allows editing of its cells through the row’s Data property. The property returns the data item the row is bound to. You should not attempt to edit a cell individually using the cell’s Value property, as this is read-only. Your data items must implement the INotifyPropertyChanged interface for the changes to be reflected in the row of xamGrid. Further, if you are planning to add and remove data items from your collection, you must implement the INotifyCollectionChanged interface for changes to be reflected.

The following code shows you how to access the data from a row of xamGrid and modify a data field.

In Visual Basic:

Dim row As Row = Me.xamGrid1.Rows(0)
Dim product As Product = TryCast(row.Data, Product)
product.ProductName = "Ice Cream"

In C#:

Row row = this.xamGrid1.Rows[0];
Product product = row.Data as Product;
product.ProductName = "Ice Cream";