Exemple #1
0
        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();
        }
Exemple #2
0
        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);
            }
        }