Hello Infragistics,
I'm trying to force the 'CurrentAddRecord' to become a newly ActiveRecord in a xamDataGrid.
Basically, I've got a condition where I'm populating cell contents in the CurrentAddRecord [if the user presses a tab key and the cell is empty - checked in CellDeactivating()].
If the user completely tabs across all the columns, my CurrentAddRecord contains a default value for each column.
On another button click (outside the grid), I check for an active record and then call an ExecuteCommand for 'CommitChangesToActiveRecord' - but I need to somehow make the CurrentAddRecord (which now contains my default populated values in each cell/column) the active one first.
How is this done or am I off track in my approach?
Thanks!
Hello,
Recently, we exposed a new method of the RecordManager class - CommitAddNewRecord:
XamDataGrid.RecordManager.CommitAddRecord(); so you can call that directly.
Another way would be to handle RecordAdded event and cache the e.Record somewhere.
DataRecord currentAddRecord;
void RecordActivated(...)
{
currentAddRecord = e.Record;
}
Then, you can set the IsActive property of the record or ActiveRecord (of the XamDataGrid) and execute the command.