Welcome to the Xceed Community Sign in | Join | Help
Community Search  

Unable to get ColumnManager to use bold for column headers in detail grid

Sort Posts: Previous Next
  •  07-14-2008, 1:33 PM Post no. 13542

    Unable to get ColumnManager to use bold for column headers in detail grid

    I add a column manager for a detail grid (which works fine).  I then set a new font with bold as follows:

     

    ColumnManagerRow columnManager = new ColumnManagerRow();

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

    But the headers aren't in bold.  I do the same thing for the main grid and it works fine.

     

    Bernie

  •  07-15-2008, 12:21 PM Post no. 13561 in reply to 13542

    Re: Unable to get ColumnManager to use bold for column headers in detail grid

    This works fine here.  Can you post a bit more details/code on how you set you grid and detail grid?
    André
    Software Developer and Tech Support
    Xceed Software Inc.
  •  07-15-2008, 3:12 PM Post no. 13566 in reply to 13561

    Re: Unable to get ColumnManager to use bold for column headers in detail grid

    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();

  •  07-16-2008, 4:11 PM Post no. 13581 in reply to 13566

    Re: Unable to get ColumnManager to use bold for column headers in detail grid

    Looking at your code, I don't see anything wrong that could explain this.  If you are entitled to support, you can send us a sample application reproducing the issue, so we can investigate this further.

    You can also try to make a simple project where you set only the minimum properties you need to do this, with one column, etc..., and see if it works.  If it does, then start adding properties and columns to the application, until you reproduce the issue.


    André
    Software Developer and Tech Support
    Xceed Software Inc.
View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2008 Xceed Software Inc.