Completed
Last Updated: 07 Jan 2015 16:33 by ADMIN
ADMIN
Dimitar
Created on: 11 Dec 2014 15:41
Category: GridView
Type: Bug Report
1
FIX. RadGridView - NullReference exception when using message box in CellValueChanged event.
To reproduce:
- Add combobox column and filter the grid so just one row is visible.
- In CellValueChanged event show a message box.
- Change the value in the combo box column and click in the white space of the grid.

Workaround:
public class MyGridComboBoxCellElement : GridComboBoxCellElement
{
    public MyGridComboBoxCellElement(GridViewColumn column, GridRowElement row) : base(column, row)
    {
    }

    public override void SetContent()
    {
        if (this.ColumnInfo != null)
        {
            base.SetContent();
        }
    }
    protected override Type ThemeEffectiveType
    {
        get
        {
            return typeof(GridComboBoxCellElement);
        }
    }
}

void radGridView1_CreateCell(object sender, GridViewCreateCellEventArgs e)
{
    if (e.CellType == typeof(GridComboBoxCellElement))
    {
        e.CellElement = new MyGridComboBoxCellElement(e.Column, e.Row);
    }
}
0 comments