private void SetGridMode(bool groupList) { this.isGridGrouped = groupList; if (this.isGridGrouped) { this.gridExCurrentList = gridExAgreementsListGrouped; this.gridListGroupedRepo = new GridAgreementsListGroupedRepo(); this.gridListGroupedRepo.BindDataSet(gridExCurrentList); this.gridExCurrentList.RootTable.Groups.Clear(); this.gridExCurrentList.RootTable.Groups.Add(new GridEXGroup(this.gridExCurrentList.RootTable.Columns["IdUmowy"])); } else { this.gridExCurrentList = gridExAgreementsList; this.gridListRepo = new GridAgreementsListRepo(); this.gridListRepo.BindDataSet(gridExCurrentList); this.gridExCurrentList.RootTable.Groups.Clear(); } gridExAgreementsList.Visible = !this.isGridGrouped; gridExAgreementsListGrouped.Visible = this.isGridGrouped; btnRemoveAgreement.Enabled = !this.isGridGrouped; btnSwitchGridMode.ImageIndex = this.isGridGrouped ? 4 : 3; this.ApplyPermissions(); }
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); } }
public FrmProductsAndArticles() { InitializeComponent(); this.gridProductsAndArticlesRepo = new GridProductsAndArticlesRepo(); this.gridAgreementsListGroupedRepo = new GridAgreementsListGroupedRepo(); this.ApplyPermissions(); this.LoadData(); }
public FrmDescriptorChanges() { InitializeComponent(); this.gridDescriptorChangesRepo = new GridDescriptorChangesRepo(); this.GridAgreementsListGroupedRepo = new GridAgreementsListGroupedRepo(); this.ApplyPermissions(); this.LoadData(); }