To reproduce:
Use the following code
private void RadGridView1_UserAddingRow(object sender, GridViewRowCancelEventArgs e)
{
radGridView1.MasterView.TableAddNewRow.CancelAddNewRow();
radGridView1.MasterView.ViewTemplate.DataView.CurrentItem.IsCurrent = false;
}
Place the new row at the bottom. While in edit mode press tab to fill until an exception is thrown.
Workaround:
BaseGridBehavior gridBehavior = radGridView1.GridBehavior as BaseGridBehavior;
gridBehavior.UnregisterBehavior(typeof(GridViewNewRowInfo));
gridBehavior.RegisterBehavior(typeof(GridViewNewRowInfo), new CustomGridRowBehavior());
internal class CustomGridRowBehavior : GridNewRowBehavior
{
protected override bool ProcessTabKey(KeyEventArgs keys)
{
bool newRowIsInEditMode = this.IsInEditMode && this.GridViewElement.CurrentRow is GridViewNewRowInfo;
if ( newRowIsInEditMode && this.GridViewElement.Navigator.IsLastEditableColumn(this.GridViewElement.CurrentColumn))
{
this.GridViewElement.Navigator.SelectFirstColumn();
while (this.GridViewElement.CurrentColumn.ReadOnly && this.GridViewElement.Navigator.SelectNextColumn())
{ }
return false;
}
return base.ProcessTabKey(keys);
}
}