Пример #1
0
            protected override GridColumn CreateColumn()
            {
                var column = new MyGridColumn();

                column.OptionsColumn.AllowEdit = false;
                return(column);
            }
Пример #2
0
        protected override BaseView CreateDefaultView()
        {
            var view = (GridView)CreateView("MyGridView");

            view.Appearance.ViewCaption.ForeColor = Color.Maroon;
            view.Appearance.HeaderPanel.ForeColor = Color.Maroon;
            view.Appearance.HeaderPanel.TextOptions.HAlignment = HorzAlignment.Center;

            view.Appearance.FooterPanel.ForeColor = Color.Maroon;
            view.Appearance.FooterPanel.Font      = new Font(new FontFamily("Tahoma"), 8.25f, FontStyle.Bold);

            view.OptionsMenu.EnableColumnMenu     = false;
            view.OptionsMenu.EnableFooterMenu     = false;
            view.OptionsMenu.EnableGroupPanelMenu = false;

            view.OptionsNavigation.EnterMoveNextColumn = true;
            view.OptionsPrint.AutoWidth        = false;
            view.OptionsPrint.PrintFooter      = false;
            view.OptionsPrint.PrintGroupFooter = false;

            view.OptionsView.ShowViewCaption            = true;
            view.OptionsView.ShowAutoFilterRow          = true;
            view.OptionsView.ShowGroupPanel             = false;
            view.OptionsView.ColumnAutoWidth            = false;
            view.OptionsView.RowAutoHeight              = true;
            view.OptionsView.HeaderFilterButtonShowMode = FilterButtonShowMode.Button;

            var idColumn = new MyGridColumn
            {
                Caption   = "Id",
                FieldName = "Id"
            };

            idColumn.OptionsColumn.AllowEdit = false;
            idColumn.OptionsColumn.ShowInCustomizationForm = false;
            view.Columns.Add(idColumn);

            var kodColumn = new MyGridColumn
            {
                Caption   = "Kod",
                FieldName = "Kod",
                Visible   = true
            };

            kodColumn.OptionsColumn.AllowEdit = false;
            kodColumn.AppearanceCell.TextOptions.HAlignment = HorzAlignment.Center;
            kodColumn.AppearanceCell.Options.UseTextOptions = true;
            view.Columns.Add(kodColumn);

            return(view);
        }