Completed
Last Updated: 16 Mar 2015 15:15 by ADMIN
ADMIN
Hristo
Created on: 04 Feb 2015 06:53
Category: GridView
Type: Bug Report
0
FIX. RadGridView - Cell value is cleared when the CellBeginEdit event is canceled and the focus is moved to another control
It does not matter the type of the control that we want to move the focus on as well as if it was RadControl or not

To reproduce:
 private void radGridView1_CellBeginEdit(object sender, Telerik.WinControls.UI.GridViewCellCancelEventArgs e)
        {
            e.Cancel = true;
            // Some other control to move the focus on
            this.textBox1.Focus();
        }

Workaround:
Before cancelling the event set the value of the active editor to the current cell value

private void radGridView1_CellBeginEdit(object sender, Telerik.WinControls.UI.GridViewCellCancelEventArgs e)
{
    this.radGridView1.ActiveEditor.Value = e.Row.Cells[e.Column.Name].Value;
    e.Cancel = true;
    // Some other control to move the focus on
    this.textBox1.Focus();
}
0 comments