Completed
Last Updated: 11 Feb 2016 14:42 by ADMIN
ADMIN
Dess | Tech Support Engineer, Sr.
Created on: 20 Jan 2016 12:37
Category: GridView
Type: Bug Report
1
FIX. RadGridView - NullReferenceException when moving the horizontal scroll-bar while the new row is in edit mode and the current column is GridViewCheckBoxColumn
Please refer to the attached sample project.

Workaround:

public class MyGridCheckBoxCellElement : GridCheckBoxCellElement
{
    public MyGridCheckBoxCellElement(GridViewColumn column, GridRowElement row) : base(column, row)
    {
    }

    protected override Type ThemeEffectiveType
    {
        get
        {
            return typeof(GridCheckBoxCellElement);
        }
    }

    public override bool IsCompatible(GridViewColumn data, object context)
    {
        GridViewCheckBoxColumn col = data as GridViewCheckBoxColumn;
        if (col != null)
        {
            return col.ThreeState == ((RadCheckBoxEditor)this.Editor).ThreeState;
        }
        return base.IsCompatible(data, context);
    }
}

private void radGridView1_CreateCell(object sender, GridViewCreateCellEventArgs e)
{
    if (e.CellType == typeof(GridCheckBoxCellElement))
    {
        e.CellElement = new MyGridCheckBoxCellElement(e.Column, e.Row);
    }
}
Attached Files:
(Total attached files size should be smaller than 20mb. Allowed extensions: .zip, .rar, .jpg, .png, .gif)
0 comments