To reproduce:
- Open the hierarchy example in the demo application.
- Select Auto-GenratedDataSet and add a new row in the third level template.
- Select Manually generated for Bound Mode and then re-select Auto-GenratedDataSet
- Try to add new row again. Yo will notice that the new row is not added.
Workaround:
class MyNewRowBehavior : GridNewRowBehavior
{
protected override bool ProcessEnterKey(KeyEventArgs keys)
{
if (this.GridControl.IsInEditMode)
{
GridViewSynchronizationService.SuspendEvent(this.GridControl.CurrentRow.ViewTemplate, KnownEvents.CurrentChanged);
bool result = base.ProcessEnterKey(keys);
GridViewSynchronizationService.ResumeEvent(this.GridControl.CurrentRow.ViewTemplate, KnownEvents.CurrentChanged);
return result;
}
else
{
return base.ProcessEnterKey(keys);
}
}
protected override bool ProcessTabKey(KeyEventArgs keys)
{
if (this.GridControl.IsInEditMode)
{
GridViewSynchronizationService.SuspendEvent(this.GridControl.CurrentRow.ViewTemplate, KnownEvents.CurrentChanged);
bool result = base.ProcessTabKey(keys);
GridViewSynchronizationService.ResumeEvent(this.GridControl.CurrentRow.ViewTemplate, KnownEvents.CurrentChanged);
this.Navigator.SelectNextColumn();
return result;
}
else
{
return base.ProcessTabKey(keys);
}
}
}
The default behavior can be changed as follows:
((BaseGridBehavior)radGridView1.GridBehavior).UnregisterBehavior(typeof(GridViewNewRowInfo));
((BaseGridBehavior)radGridView1.GridBehavior).RegisterBehavior(typeof(GridViewNewRowInfo), new MyNewRowBehavior());