Completed
Last Updated: 08 Jan 2016 09:00 by ADMIN
ADMIN
Jack
Created on: 04 Apr 2012 04:47
Category: GridView
Type: Bug Report
1
FIX. RadGridView - when clicking on the expander cell the grid scrolls to the currently selected column which in some cases causes unnecessary scrolling
Currently when clicking on the expander cell RadGridView scrolls to the currently selected column which in some cases causes unnecessary scrolling

Workaround:
public class CustomGridControl : RadGridView
{
    public override string ThemeClassName
    {
        get
        {
            return typeof(RadGridView).FullName;
        }
        set
        {
        }
    }
 
    protected override void OnMouseDown(MouseEventArgs e)
    {
        RadElement element = this.ElementTree.GetElementAtPoint(e.Location);
        GridGroupExpanderCellElement expanderCell = element as GridGroupExpanderCellElement;
        if (expanderCell == null)
        {
            expanderCell = element.FindAncestor<GridGroupExpanderCellElement>();
        }
        if (expanderCell != null)
        {
            this.TableElement.BeginUpdate();
            expanderCell.RowInfo.IsExpanded = !expanderCell.RowInfo.IsExpanded;
            this.TableElement.HScrollBar.Value = 0;
            this.TableElement.EndUpdate();
            return;
        }
 
        base.OnMouseDown(e);
    }
}
0 comments