// to disable the editmode of addnewrow in sfgrid
this.dataGrid.CurrentCellBeginEdit += dataGrid_CurrentCellBeginEdit;
void dataGrid_CurrentCellBeginEdit(object sender, CurrentCellBeginEditEventArgs args)
{
if (this.dataGrid.IsAddNewIndex(args.RowColumnIndex.RowIndex))
{
args.Cancel = !args.Column.AllowEditing;
}
}
// to disable the focus of addnewrow in sfgrid
this.dataGrid.CurrentCellActivating += DataGrid_CurrentCellActivating;
private void DataGrid_CurrentCellActivating(object sender, CurrentCellActivatingEventArgs e)
{
if (this.dataGrid.IsAddNewIndex(e.CurrentRowColumnIndex.RowIndex))
{
var col = e.CurrentRowColumnIndex.ColumnIndex;
var focus = this.dataGrid.GetDataColumnBase(e.CurrentRowColumnIndex);
e.Cancel = !focus.GridColumn.AllowFocus;
}
}
|