Completed
Last Updated: 16 Dec 2015 12:17 by ADMIN
ADMIN
Stefan
Created on: 12 Feb 2014 14:48
Category: GridView
Type: Bug Report
0
FIX. RadGridView - hierarchical grid with PageViewMode = ExplorerBar, does not indicate row selection correctly
To reproduce:
-add hierarchical RadGriddView with one parent template and several child templates;
-set TableElement.PageViewMode to PageViewMode.ExplorerBar;


Selection for different templates is not performed correcltly.


Workaround: use custom GridDataRowBehavior:


BaseGridBehavior gridBehavior = this.radGridView1.GridBehavior as BaseGridBehavior;
            gridBehavior.UnregisterBehavior(typeof(GridViewDataRowInfo));
            gridBehavior.RegisterBehavior(typeof(GridViewDataRowInfo),
                new RowSelectionGridBehavior());


public class RowSelectionGridBehavior : GridDataRowBehavior
{
    protected override bool OnMouseDownLeft(MouseEventArgs e)
    {
        GridDataRowElement row = this.GetRowAtPoint(e.Location) as GridDataRowElement;
        if (row != null)
        {
            row.RowInfo.IsSelected = true;
            row.RowInfo.IsCurrent = true;


            return true;
        }


        return base.OnMouseDownLeft(e);
    }
}
0 comments