예제 #1
0
        /// <summary>
        /// 初始化操作
        /// </summary>
        protected override void InitializeForm()
        {
            if ((_SummaryView != null) && (_SummaryView.View is GridView))
            {
                GridView gridView = _SummaryView.View as GridView;

                frmGridCustomize.RegisterGrid(gridView);                    //注册表格配置功能
                DevStyle.SetGridControlLayout(gridView.GridControl, false); //设置表格样式
                DevStyle.SetSummaryGridViewLayout(gridView);

                gridView.DoubleClick += new EventHandler(OnGridViewDoubleClick);             //主表DoubleClict
                this.BindingSummaryNavigator(controlNavigatorSummary, gridView.GridControl); //Summary导航条.
            }

            this.ShowSummary();         //下载显示数据.
            this.ShowSummaryPage(true); //一切初始化完毕後显示SummaryPage

            base.InitializeForm();
        }
예제 #2
0
        /// <summary>
        /// 设置明细表格布局. OptionsView,OptionsCustomization设置
        /// </summary>
        public static void SetDetailGridViewLayout(GridView gridView)
        {
            DevStyle.SetGridReadColumnStyle(gridView);

            gridView.GridControl.BeginInit();
            gridView.OptionsNavigation.EnterMoveNextColumn = false;//注意: 禁止Grid管理Enter键
            gridView.OptionsView.ShowGroupPanel            = false;
            gridView.OptionsView.ColumnAutoWidth           = false;
            gridView.OptionsView.NewItemRowPosition        = NewItemRowPosition.None;
            gridView.OptionsView.EnableAppearanceOddRow    = true;
            //gridView.Appearance.OddRow.BackColor = System.Drawing.Color.FromName(SystemConfig.CurrentConfig.GridOddColorName);
            //gridView.Appearance.OddRow.Options.UseBackColor = SystemConfig.CurrentConfig.GridAllowOddColor;
            gridView.OptionsCustomization.AllowFilter             = false;
            gridView.OptionsCustomization.AllowSort               = false;
            gridView.OptionsSelection.EnableAppearanceFocusedCell = true;
            foreach (GridColumn col in gridView.Columns)
            {
                if ((col.OptionsColumn.AllowEdit == false) || (col.OptionsColumn.ReadOnly == true))
                {
                    col.AppearanceCell.BackColor = SystemColors.ButtonFace;
                }
            }
            gridView.GridControl.EndInit();
        }