예제 #1
0
 /// <summary>
 /// 컬럼 고정
 /// </summary>
 /// <param name="colName">컬럼명</param>
 /// <param name="fixStyle">고정스타일</param>
 public void ColumnFix(string colName, FixedStyle fixStyle = FixedStyle.Left)
 {
     if (MainView.Columns.Cast <GridColumn>().Where(x => x.FieldName == colName).Any())
     {
         MainView.Columns[colName].Fixed = fixStyle;
     }
 }
        void OnFixedItemClickCore(FixedStyle style, PopupMenuItem item, EventHandler eventHandler)
        {
            item.Click -= eventHandler;

            if (ActiveColumn == null)
            {
                return;
            }

            ActiveColumn.FixedStyle = style;
            ActiveColumn            = null;
        }
예제 #3
0
        protected int CalcFixedColumnsCount(FixedStyle fixedStyle)
        {
            int count = 0;

            foreach (TreeListColumn column in TreeList.VisibleColumns)
            {
                if (column.Fixed == fixedStyle)
                {
                    count++;
                }
            }
            return(count);
        }
예제 #4
0
        private void InitializeColumn(string bandCaption, string caption, FixedStyle fixedStyle)
        {
            GridBand band = _View.Bands.AddBand(bandCaption);

            band.Fixed          = fixedStyle;
            _Column.FieldName   = "Unbound" + _View.Columns.Count;
            _Column.Caption     = caption;
            _Column.UnboundType = DevExpress.Data.UnboundColumnType.String;
            _Column.Visible     = true;
            _Column.OptionsColumn.AllowFocus  = false;
            _Column.OptionsFilter.AllowFilter = false;
            _Column.OptionsColumn.AllowGroup  = DevExpress.Utils.DefaultBoolean.False;
            _Column.OptionsColumn.AllowSort   = DevExpress.Utils.DefaultBoolean.False;
            band.Columns.Add(_Column);
        }
예제 #5
0
 /// <summary>
 /// Thiet lap co dinh cac field
 /// </summary>
 /// <param name="grid"></param>
 /// <param name="fieldName"></param>
 /// <param name="style"></param>
 public static void FixedField(GridView grid, string[] fieldName, FixedStyle style)
 {
     if (fieldName == null)
     {
         return;
     }
     for (int i = 0; i < fieldName.Length; i++)
     {
         if (fieldName[i].Trim() == "")
         {
             continue;
         }
         grid.Columns[fieldName[i]].Fixed = style;
     }
 }
예제 #6
0
 public MenuInfo(GridColumn column, FixedStyle style)
 {
     this.Column = column;
     this.Style  = style;
 }
예제 #7
0
        //Create a menu item
        public static DXMenuCheckItem CreateCheckItem(string caption, GridColumn column, FixedStyle style, Color color)
        {
            Image           image = createImage(color);
            DXMenuCheckItem item  = new DXMenuCheckItem(caption, column.Fixed == style, image, new EventHandler(OnFixedClick));

            item.Tag = new MenuInfo(column, style);
            return(item);
        }
예제 #8
0
 public Column(string field, string header, ColumnFieldTypes type, string mask = null, FixedStyle fixedStyle = FixedStyle.None)
 {
     this.FieldName  = field;
     this.Header     = header;
     this.FieldType  = type;
     this.Mask       = mask;
     this.FixedStyle = fixedStyle;
 }
예제 #9
0
 public MenuInfo(GridColumn column, FixedStyle style)
 {
     this.Column = column;
     this.Style = style;
 }
예제 #10
0
 DXMenuCheckItem CreateCheckItem(string caption, GridColumn column, FixedStyle style, Image image)
 {
     DXMenuCheckItem item = new DXMenuCheckItem(caption, column.Fixed == style, image, new EventHandler(OnFixedClick));
     item.Tag = new MenuInfo(column, style);
     if (caption == "Not Fixed")
         item.BeginGroup = true;
     return item;
 }
 /// <summary>
 /// Tạo band trong lưới
 /// </summary>
 private GridBand CreateBand(string caption, int index, int width, FixedStyle fix)
 {
     GridBand band = new GridBand();
     band.Caption = caption;
     band.Width = width;
     band.OptionsBand.FixedWidth = true;
     band.Fixed = fix;
     band.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
     band.AppearanceHeader.TextOptions.WordWrap = DevExpress.Utils.WordWrap.Wrap;
     band.AppearanceHeader.Options.UseTextOptions = true;
     return band;
 }
예제 #12
0
 public RowHeaderHelper(AdvBandedGridView view, string bandCaption, string caption, FixedStyle fixedStyle)
 {
     _View = view;
     InitializeColumn(bandCaption, caption, fixedStyle);
     _View.CustomDrawCell += _View_CustomDrawCell;
 }
예제 #13
0
 public MenuInfo(GridColumn column, FixedStyle style)
 {
     Column = column;
     Style  = style;
 }
예제 #14
0
        /// <summary>
        /// 创建GridView的列
        /// </summary>
        public static GridColumn CreateColumn(this GridView gridView, string fieldName, string caption, int width = 80, bool allowEdit = true,
                                              UnboundColumnType unboundColumnType = UnboundColumnType.Bound, DefaultBoolean allowMerge = DefaultBoolean.False,
                                              FixedStyle fixedStyle = FixedStyle.None)
        {
            //使用多语言处理标题
            caption = JsonLanguage.Default.GetString(caption);

            GridColumn gridColumn = new GridColumn
            {
                FieldName   = fieldName,
                Caption     = caption,
                Width       = width,
                UnboundType = unboundColumnType
            };

            gridView.Columns.Add(gridColumn);
            gridColumn.AbsoluteIndex = gridView.Columns.Count;
            gridColumn.VisibleIndex  = gridView.Columns.Count;
            gridColumn.AppearanceHeader.TextOptions.HAlignment = HorzAlignment.Center;
            gridColumn.AppearanceCell.TextOptions.VAlignment   = VertAlignment.Center;
            gridColumn.OptionsColumn.AllowEdit = allowEdit;

            if (!allowEdit)
            {
                gridColumn.AppearanceHeader.ForeColor = Color.Gray;
            }

            bool allowCellMerge = !gridView.OptionsView.AllowCellMerge && allowMerge == DefaultBoolean.True;

            if (allowCellMerge)
            {
                gridView.OptionsView.AllowCellMerge = true;
            }
            gridColumn.OptionsColumn.AllowMerge = allowMerge;
            gridColumn.Fixed = fixedStyle;

            bool isTime = caption.Contains("时间");

            if (isTime)
            {
                gridColumn.DisplayFormat.FormatType   = FormatType.DateTime;
                gridColumn.DisplayFormat.FormatString = "yyyy-MM-dd HH:mm:ss";
            }
            else
            {
                bool isDate = caption.Contains("日期");
                if (isDate)
                {
                    gridColumn.DisplayFormat.FormatType   = FormatType.DateTime;
                    gridColumn.DisplayFormat.FormatString = "yyyy-MM-dd";
                }
                else
                {
                    bool isPercent = caption.Contains("百分比") || caption.Contains("率");
                    if (isPercent)
                    {
                        gridColumn.DisplayFormat.FormatType   = FormatType.Numeric;
                        gridColumn.DisplayFormat.FormatString = "P";
                    }
                }
            }
            return(gridColumn);
        }
예제 #15
0
        private string _ColumnXmlCfgName;     //

        public GridColumnLayoutInfo()
        {
            _Childs = new List <GridColumnLayoutInfo>();
            _Fixed  = FixedStyle.None;
        }