This example shows how to edit the values in selected cells at the same time.
bool lockEvents;
private void OnCellValueChanged(CellValueChangedEventArgs e)
{
if (lockEvents)
return;
lockEvents = true;
SetSelectedCellsValues(e.Value);
lockEvents = false;
}
private void SetSelectedCellsValues(object value)
{
try {
view.BeginUpdate();
GridCell[] cells = view.GetSelectedCells();
ChangeMode mode = (ChangeMode)radioGroup.EditValue;
foreach(GridCell cell in cells) {
int rowHandle = cell.RowHandle;
GridColumn column = cell.Column;
switch(mode) {
case ChangeMode.All:
break;
case ChangeMode.Column:
column = view.FocusedColumn;
break;
case ChangeMode.Row:
rowHandle = view.FocusedRowHandle;
break;
}
view.SetRowCellValue(rowHandle, column, value);
}
}
catch(Exception ex) { }
finally { view.EndUpdate(); }
}
(you will be redirected to DevExpress.com to submit your response)