Approved
Last Updated: 19 Jun 2017 11:20 by ADMIN
ADMIN
Dess | Tech Support Engineer, Sr.
Created on: 19 Jun 2017 10:08
Category: GridView
Type: Bug Report
1
FIX. RadGridView - vertical scrollbar jumps when hiding/showing a column and the AutoSizeRows property is set to true
To reproduce: please refer to the attached gif file.
1. Run the attached sample project.
2. Toggle the checkbox and scroll to a specific row.
3. Click the button to hide a column. You will notice that the vertical scrollbar changes its position. If the AutoSizeRows property is set to false, the scrollbar keeps its position.

Workaround:
private void radToggleButton1_ToggleStateChanged(object sender, Telerik.WinControls.UI.StateChangedEventArgs args)
{
    int scrollBarValue = this.radGridView1.TableElement.VScrollBar.Value;
    bool visible = true;
    if (args.ToggleState == Telerik.WinControls.Enumerations.ToggleState.On)
    {
        visible = false;
    }
    this.radGridView1.MasterTemplate.BeginUpdate();
    for (int i = 1; i < this.radGridView1.Columns.Count; i += 2)
    {
        this.radGridView1.Columns[i].IsVisible = visible;
    }
    this.radGridView1.MasterTemplate.EndUpdate();
    this.radGridView1.TableElement.VScrollBar.Value = scrollBarValue;
}

0 comments