private async Task CreateColumns()
        {
            _loadColumns = true;
            if (Controller == null)
                return;

            var techOpers = await Controller.GetTechOperationsAsync();
            var indexColumn = gvSelectDrawings.Columns.Max(x => x.VisibleIndex) - 1;
            foreach (var techOperation in techOpers)
            {
                if (gvSelectDrawings.Columns.All(x => x.Name != (ColumnTechOperStart + techOperation.Id.ToString())))
                {
                    var column = new GridColumn
                    {
                        Name = ColumnTechOperStart + techOperation.Id,
                        Caption = techOperation.ShortName,
                        Visible = true,
                        VisibleIndex = indexColumn++,
                        UnboundType = UnboundColumnType.Boolean,
                        Width = 10
                    };

                    column.OptionsColumn.AllowEdit = false;
                    column.OptionsColumn.AllowSize = true;
                    //column.OptionsColumn.AllowShowHide = false;
                    column.FieldName = column.Name;

                    gvSelectDrawings.Columns.Add(column);
                }
            }

            gvSelectDrawings.Appearance.HeaderPanel.TextOptions.WordWrap = WordWrap.Wrap;
            gvSelectDrawings.ColumnPanelRowHeight = 40;
            var aaa = new AutoHeightHelper(gvSelectDrawings);
            aaa.EnableColumnPanelAutoHeight();
            _loadColumns = false;
        }
Beispiel #2
0
        private void InitGridLayout()
        {
            var techOpers = VisibleTechOperations;

            var indexColumn = CreateColumns(techOpers);

            colButtonSave.AbsoluteIndex = indexColumn;
            gvRateHierDrawings.Appearance.HeaderPanel.TextOptions.WordWrap = WordWrap.Wrap;
            var aaa = new AutoHeightHelper(gvRateHierDrawings);
            aaa.EnableColumnPanelAutoHeight();
        }
        private void CreateColumns()
        {
            gvRateHierDrawings.CustomSummaryCalculate += GvRateHierDrawings_CustomSummaryCalculate;

            if (Controller == null)
                return;

            var techOpers = Controller.GetTechOperations();
            var indexColumn = gvRateHierDrawings.Columns.Max(x => x.VisibleIndex) - 1;
            foreach (var techOperation in techOpers)
            {
                if (gvRateHierDrawings.Columns.All(x => x.Name != (ColumnTechOperStart + techOperation.Id.ToString())))
                {
                    var column = new GridColumn
                    {
                        Name = ColumnTechOperStart + techOperation.Id,
                        Caption = techOperation.ShortName,
                        Visible = true,
                        VisibleIndex = indexColumn,
                        UnboundType = UnboundColumnType.Decimal,
                        Width = 10
                    };

                    column.OptionsColumn.AllowSize = true;
                    column.FieldName = column.Name;
                    gvRateHierDrawings.Columns.Add(column);

                    column.SummaryItem.SummaryType = SummaryItemType.Custom;
                    column.SummaryItem.DisplayFormat = "{0:n2}";
                }
            }

            colButtonSave.AbsoluteIndex = indexColumn;
            gvRateHierDrawings.Appearance.HeaderPanel.TextOptions.WordWrap = WordWrap.Wrap;
            gvRateHierDrawings.ColumnPanelRowHeight = 40;
            var aaa = new AutoHeightHelper(gvRateHierDrawings);
            aaa.EnableColumnPanelAutoHeight();
        }
        private async Task CreateColumns()
        {
            if (Controller == null)
                return;

            var techOpers = Controller.IsEnabledEditField(ColumnTechOperStart)
                ? Controller.GetAllTechOperations()
                : await Controller.GetTechOperationsAsync();

            var indexColumn = gvDrawings.Columns.Max(x => x.VisibleIndex) - 1;
            foreach (var techOperation in techOpers)
            {
                if (gvDrawings.Columns.All(x => x.Name != (ColumnTechOperStart + techOperation.Id.ToString())))
                {
                    var column = new GridColumn
                    {
                        Name = ColumnTechOperStart + techOperation.Id,
                        Caption = techOperation.ShortName,
                        ColumnEdit = repCheckEdit,
                        Visible = true,
                        VisibleIndex = indexColumn++,
                        UnboundType = UnboundColumnType.Boolean,
                        Width = 10
                    };

                    //column.Visible = !HideDeletedOperations || !techOperation.IsDelete;

                    column.OptionsColumn.AllowSize = true;
                    column.FieldName = column.Name;
                    gvDrawings.Columns.Add(column);
                }
            }

            colButtonSave.AbsoluteIndex = indexColumn;
            gvDrawings.Appearance.HeaderPanel.TextOptions.WordWrap = WordWrap.Wrap;
            gvDrawings.ColumnPanelRowHeight = 40;
            var aaa = new AutoHeightHelper(gvDrawings);
            aaa.EnableColumnPanelAutoHeight();
        }