Completed
Last Updated: 15 Aug 2017 10:20 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 23 Feb 2017 09:59
Category: GridView
Type: Bug Report
1
FIX. RadGridView - visual glitch when hiding the group headers of the ColumnGroupsViewDefinition
Please refer to the attached sample project and gif file illustrating the behavior.
ColumnGroupsViewDefinition view = this.radGridView1.ViewDefinition as ColumnGroupsViewDefinition;

            foreach (GridViewColumnGroup group in view.ColumnGroups)
            {
                group.ShowHeader = false;
            }

Workaround: use the ViewCellFormatting and enable the back color for the header cells that are over the hidden group headers

public RadForm1()
{
    InitializeComponent();

    ColumnGroupsViewDefinition view = this.radGridView1.ViewDefinition as ColumnGroupsViewDefinition ;
    foreach (GridViewColumnGroup group in view.ColumnGroups)
    {
        group.ShowHeader = false;
    }
}

private void radGridView1_ViewCellFormatting(object sender, CellFormattingEventArgs e)
{
    if (e.Row is GridViewTableHeaderRowInfo && !(e.CellElement is GridColumnGroupCellElement))
    {
        e.CellElement.DrawFill = true;
        e.CellElement.BackColor = Color.FromArgb(234, 242, 252);
        e.CellElement.GradientStyle = GradientStyles.Solid;
    }
    else
    { 
        e.CellElement.ResetValue(LightVisualElement.DrawFillProperty, ValueResetFlags.Local);
        e.CellElement.ResetValue(LightVisualElement.BackColorProperty, ValueResetFlags.Local);
        e.CellElement.ResetValue(LightVisualElement.GradientStyleProperty, ValueResetFlags.Local);
    }
}
0 comments