To reproduce: use the attached sample project. Follow the steps illustrated on the attached gif file.
Workaround: keep the vertical scrollbar value and maximum before modifying the child rows and restore them afterwards:
private void gridViewParameter_CellValueChanged(object sender, GridViewCellEventArgs e)
{
if (e.Column.Name == "Select")
{
this.gridViewParameter.CellValueChanged -= gridViewParameter_CellValueChanged;
GridViewRowInfo selectedRowinfo = e.Row;
if (selectedRowinfo.HasChildRows())
{
int scrollValue = this.gridViewParameter.TableElement.VScrollBar.Value;
int scrollMax = this.gridViewParameter.TableElement.VScrollBar.Maximum;
this._UpdateUiState(selectedRowinfo.ChildRows, Convert.ToBoolean(selectedRowinfo.Cells["Select"].Value));
this.gridViewParameter.TableElement.VScrollBar.Maximum = scrollMax;
this.gridViewParameter.TableElement.VScrollBar.Value = scrollValue;
}
this.gridViewParameter.CellValueChanged += gridViewParameter_CellValueChanged;
}
}
NOTE: after applying the workaround, there is annoying flickering illustrated on the Flickering.gif file which should be handled if possible.