Completed
Last Updated: 24 Jul 2015 10:42 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 06 Jul 2015 13:34
Category: GridView
Type: Bug Report
0
FIX. RadGridView - NullReferenceException when clicking over the filter icon and the multiple selection is enabled
1. Use the following code snippet:
public Form1()
{
    InitializeComponent();

    this.radGridView1.MasterTemplate.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill;
    this.radGridView1.MasterTemplate.EnableAlternatingRowColor = true;
    this.radGridView1.MasterTemplate.EnableFiltering = true;
    this.radGridView1.MasterTemplate.MultiSelect = true;

    for (int i = 0; i < 3; i++)
    {
        this.radGridView1.Columns.Add("Col"+i);
    }
    radGridView1.Rows.Add("test1", "test1", "test1");
    radGridView1.Rows.Add("test2", "test2", "test2");
    radGridView1.Rows.Add("test3", "test3", "test3");
    radGridView1.Rows.Add("test4", "test4", "test4");
    radGridView1.Rows.Add("test5", "test5", "test5");
}

2. Quickly click around  the cells a few times, making sure to drag your mouse a bit  to select a few rows on some of the clicks.
Then quickly click the filter. (sometimes it takes a few tries)

Workaround: use custom GridFilterRowBehavior

            BaseGridBehavior gridBehavior = radGridView1.GridBehavior as BaseGridBehavior;
            gridBehavior.UnregisterBehavior(typeof(GridViewFilteringRowInfo));
            gridBehavior.RegisterBehavior(typeof(GridViewFilteringRowInfo), new CustomGridFilterRowBehavior());

public class CustomGridFilterRowBehavior : GridFilterRowBehavior
{
    protected override bool ProcessMouseSelection(Point mousePosition, GridCellElement currentCell)
    { 
        return false;
    }
}
Attached Files:
0 comments