Home Forums WinForms controls Xceed Grid for WinForms Unable to get ColumnManager to use bold for column headers in detail grid Reply To: Unable to get ColumnManager to use bold for column headers in detail grid

User (Old forums)
Member
Post count: 23064

styleMiddle =

new Column();

styleMiddle.Font =

new System.Drawing.Font(“Microsoft Sans Serif”, 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));

styleMiddle.HorizontalAlignment = Xceed.Grid.

HorizontalAlignment.Center;

styleValue =

new Column();

styleValue.HorizontalAlignment = Xceed.Grid.

HorizontalAlignment.Right;

styleMoney =

new Column();

styleMoney.HorizontalAlignment = Xceed.Grid.

HorizontalAlignment.Right;

styleMoney.FormatSpecifier =

“N2”;

styleGreeks =

new Column();

styleGreeks.HorizontalAlignment = Xceed.Grid.

HorizontalAlignment.Right;

styleGreeks.FormatSpecifier =

“.0000”;

gridControl.ReadOnly =

true;

gridControl.BeginInit();

gridControl.SelectionMode =

SelectionMode.None;

//gridControl.SideMargin.Visible = false;

gridControl.FixedColumnSplitter.Visible =

false;

gridControl.RowSelectorPane.Visible =

false;

gridControl.UIStyle = Xceed.UI.

UIStyle.WindowsClassic;

Column col;

col =

new Column(“Description”, typeof(string));

col.Width = 150;

col.Font =

new Font(gridControl.Font, FontStyle.Bold);

col.CanBeSorted =

false;

gridControl.Columns.Add(col);

col =

new Column(“DTE”, typeof(int));

col.Width = 40;

col.CanBeSorted =

false;

gridControl.Columns.Add(col);

col =

new Column(“Deliverables”, typeof(string));

col.Width = 150;

col.CanBeSorted =

false;

gridControl.Columns.Add(col);

col =

new Column(“Style”, typeof(string));

col.Width = 40;

col.CanBeSorted =

false;

gridControl.Columns.Add(col);

ColumnManagerRow cmrow = new ColumnManagerRow();

cmrow.Font =

new Font(gridControl.Font, FontStyle.Bold);

cmrow.HotTracking =

false;

gridControl.FixedHeaderRows.Add(cmrow);

//gridControl.DataRowTemplate.Font = new Font(gridControl.Font, FontStyle.Bold);

lowCallColumn = 0;

detailStrikes =

new DetailGrid();

detailStrikes.ReadOnly =

true;

detailStrikes.FixedColumnSplitter.Visible =

false;

detailStrikes.CollapsedChanged +=

new EventHandler(detailStrikes_CollapsedChanged);

ChainColumnManagerRow chainManager = new ChainColumnManagerRow(4);

chainManager.Font =

new Font(gridControl.Font, FontStyle.Bold);

detailStrikes.HeaderRows.Add(chainManager);

ColumnManagerRow columnManager = new ColumnManagerRow();

columnManager.Font =

new Font(gridControl.Font, FontStyle.Bold);

columnManager.HotTracking =

false;

detailStrikes.HeaderRows.Add(columnManager);

SetupChainColumnSide(

“Call”);

SetupChainColumnMiddle();

lowPutColumn = detailStrikes.Columns.Count;

SetupChainColumnSide(

“Put”);

detailStrikes.BackColor =

Color.White;

detailStrikes.DataRowTemplate.Cells[bidCallColumn].DoubleClick

+=

new EventHandler(ChainControlNew_DoubleClick);

detailStrikes.DataRowTemplate.Cells[bidCallColumn+1].DoubleClick

+=

new EventHandler(ChainControlNew_DoubleClick);

detailStrikes.DataRowTemplate.Cells[bidPutColumn].DoubleClick

+=

new EventHandler(ChainControlNew_DoubleClick);

detailStrikes.DataRowTemplate.Cells[bidPutColumn + 1].DoubleClick

+=

new EventHandler(ChainControlNew_DoubleClick);

//detailStrikes.DataRowTemplate.Font = new Font(gridControl.Font, FontStyle.Bold);

gridControl.DetailGridTemplates.Add(detailStrikes);

gridControl.EndInit();

Imported from legacy forums. Posted by Bernard (had 659 views)