public void LoadAgreementsList() { int previouslySelectedIndex = 0; if (gridExCurrentList.CurrentRow != null && gridExCurrentList.CurrentRow.RowIndex > -1) { previouslySelectedIndex = gridExCurrentList.CurrentRow.RowIndex; } if (this.isGridGrouped) { this.gridListGroupedRepo = new GridAgreementsListGroupedRepo(); this.gridListGroupedRepo.BindDataSet(gridExCurrentList); } else { this.gridListRepo = new GridAgreementsListRepo(); this.gridListRepo.BindDataSet(gridExCurrentList); } if (previouslySelectedIndex > 0) { gridExCurrentList.MoveToRowIndex(previouslySelectedIndex); } }