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

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #16276 |

    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

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

    User (Old forums)
    Member
    Post count: 23064

    This works fine here.  Can you post a bit more details/code on how you set you grid and detail grid?

    Imported from legacy forums. Posted by André (had 510 views)

    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)

    User (Old forums)
    Member
    Post count: 23064

    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.

    Imported from legacy forums. Posted by André (had 978 views)

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.