/// <summary> /// 밴드에 컬럼을 추가합니다. /// </summary> /// <param name="Band">The band.</param> /// <param name="Caption">The caption.</param> /// <param name="FieldName">Name of the field.</param> /// <param name="Name">The name.</param> /// <param name="Allgment">The allgment.</param> /// <param name="Width">The width.</param> private void SetAddBandColumn(DevExpress.XtraGrid.Views.BandedGrid.GridBand Band, string Caption, string FieldName, string Name, DevExpress.Utils.HorzAlignment Allgment, int Width) { try { DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn bandColumn = new BandedGridColumn(); bandColumn.AppearanceHeader.Options.UseTextOptions = true; bandColumn.AppearanceHeader.TextOptions.HAlignment = Allgment; bandColumn.Caption = Caption; bandColumn.FieldName = FieldName; bandColumn.Name = Name; bandColumn.Width = Width; Band.Columns.Add(bandColumn); } catch (Exception ex) { throw ex; } }
/// <summary> /// Set the cell horizontal alignment /// </summary> /// <param name="alignment"></param> /// <param name="colNames"></param> public void SetHAlignment(DevExpress.Utils.HorzAlignment alignment, params string[] colNames) { foreach (string col in colNames) { this.defaultView.Columns[col].AppearanceCell.TextOptions.HAlignment = alignment; } }
/// <summary> /// 設定column HAlignment (如果沒有該column也不會出錯) /// </summary> /// <param name="gv"></param> /// <param name="colName"></param> /// <param name="colCaption"></param> public static void SetColumnHAlignment(this DevExpress.XtraGrid.Views.Grid.GridView gv, string colName, DevExpress.Utils.HorzAlignment alignment) { if (gv.Columns[colName] != null) { gv.Columns[colName].AppearanceCell.Options.UseTextOptions = true; gv.Columns[colName].AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Default; } }
public void AddColumn(string fieldName, int width, string caption, DevExpress.Utils.FormatType formatType, string formatString, bool visible, DevExpress.Utils.HorzAlignment alignment) { this.Properties.Columns.Add(new LookUpColumnInfo(_dt.Columns[fieldName].ColumnName, caption, width, formatType, formatString, visible, alignment)); }
private void DrawHeaderFooter(DevExpress.XtraGrid.Views.Grid.FooterCellCustomDrawEventArgs e) { e.Painter.DrawObject(e.Info); int iWidth = (gc_HWGR.Visible) ? gc_HWGR.Width : 0; Rectangle oldBounds = e.Info.Bounds; string oldText = e.Info.DisplayText; e.Info.Bounds = new Rectangle(e.Info.Bounds.Left, e.Info.Bounds.Bottom + 1, e.Info.Bounds.Width + iWidth, e.Info.Bounds.Height); e.Info.DisplayText = _NUMBER_OF_PEOPLE_ROW; DevExpress.Utils.HorzAlignment oldHAlignment = e.Info.Appearance.TextOptions.HAlignment; e.Info.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near; e.Painter.DrawObject(e.Info); e.Info.Bounds = oldBounds; e.Info.DisplayText = oldText; e.Info.Appearance.TextOptions.HAlignment = oldHAlignment; e.Handled = true; }
private void AdjustItem(DiagramItem item, Color backC, Color foreC, Color borderC, int borderS, Font font, DevExpress.Utils.HorzAlignment horz) { item.Appearance.BackColor = backC; item.Appearance.ForeColor = foreC; item.Appearance.BorderColor = borderC; item.Appearance.BorderSize = borderS; item.Appearance.Font = font; item.Appearance.TextOptions.HAlignment = horz; }
public BvLookupColumnInfo(string fieldName, string caption, int width, DevExpress.Utils.FormatType formatType, string formatString, bool visible, DevExpress.Utils.HorzAlignment alignment) : base(fieldName, caption, width, formatType, formatString, visible, alignment) { Init(caption); }
private DevExpress.Utils.HorzAlignment GetCaptionHorizontalAlignment(IModelLayoutViewItem layoutItemModel) { DevExpress.Utils.HorzAlignment captionHorizontalAlignment = layoutItemModel.CaptionHorizontalAlignment; return(Equals(captionHorizontalAlignment, DevExpress.Utils.HorzAlignment.Default) ? DefaultLayoutItemCaptionHorizontalAlignment : captionHorizontalAlignment); }