dataGrid.CurrentCellEndEdit += DataGrid_CurrentCellEndEdit;
//current cell end edit Event Handler
private void DataGrid_CurrentCellEndEdit(object sender, GridCurrentCellEndEditEventArgs args)
{
// Will be hit here before the values are committed to the collection.
// Will be hit once the editing focus is lost for that gridcell.
// Values will be committed into the underlying collection only after the execution of this event
if (dataGrid.Columns[args.RowColumnIndex.ColumnIndex] is GridTextColumn)
{
var editedValue = this.dataGrid.CellRenderers["TextView"].GetControlValue();
}
else if (dataGrid.Columns[args.RowColumnIndex.ColumnIndex] is GridPickerColumn)
{
var editedValue = this.dataGrid.CellRenderers["Picker"].GetControlValue();
}
else if (dataGrid.Columns[args.RowColumnIndex.ColumnIndex] is GridNumericColumn)
{
var editedValue = this.dataGrid.CellRenderers["Numeric"].GetControlValue();
}
else if(dataGrid.Columns[args.RowColumnIndex.ColumnIndex] is GridDateTimeColumn)
{
var editedValue = this.dataGrid.CellRenderers["DateTime"].GetControlValue();
}
} |