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;
}