Home Forums WinForms controls Xceed Grid for WinForms Change font style of grid column headers

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

    Hi Team, 

    Does anyone know how to change grid column header font and colour?  

    Thanks,

    Michael 

    Imported from legacy forums. Posted by Michael (had 1168 views)

    Diane [Xceed]
    Moderator
    Post count: 1353

    Hi Michael,

    The headers are found in the ColumnManagerRow, and you can change its Font and ForeColor.

    For example:

       StyleSheet styleSheet = new StyleSheet();
       styleSheet.ColumnManagerRow.ForeColor = Color.Green;
       styleSheet.ColumnManagerRow.Font = new Font(“Verdana”, 8, FontStyle.Bold);
       gridControl.ApplyStyleSheet( styleSheet );

    Imported from legacy forums. Posted by Diane [Xceed] (had 323 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi Diane,

    I changed my codes to create a new StyleSheet object and apply it.

    There is error message popup at applying.

    — “The item to be demoted is either not initialized or already wrapped with a weak refernece.”

    at Xceed.Grid.Collections.VirtualListBase.DemoteToWeakRef(Int32 index)

    All the cells in grid are having borders which do not exist at the beginning.  

    Do you how to fix it?

    Thanks,

    Michael 

     

    Imported from legacy forums. Posted by Michael (had 247 views)

    Diane [Xceed]
    Moderator
    Post count: 1353

    Hi Michael,

    I was not able to reproduce the issue you describe.

    I would need a small stand-alone test project that reproduces the issue in order to investigate further. Please send it to support@xceed.com and include a link to this forum thread for reference. Thank you.

    Imported from legacy forums. Posted by Diane [Xceed] (had 241 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi Diane,

     I debug into it. I can see the error message is from VirtualListBase.cs  this line of code.

    System.Diagnostics.Debug.Assert( ( !isWeakReferenced ) && ( currentItem != null ), “The item to be demoted is either not initialized or already wrapped within a weak reference.” ); 

    If I put a break point somewhere nearby and run step by step. It is not fired all the time. It looks like a thread issue, isn’t it? 

    But it works fine in VS if I change my project from Debug mode to Release mode. How can I avoid it at debug mode? 

    About the border problem, the grid in my project had been customized to come with border in column header but no borders in data row cells.

    Do you know how to apply the style only on column header without affect other data cells? 

     

    Michael 

    Imported from legacy forums. Posted by Michael (had 352 views)

    Diane [Xceed]
    Moderator
    Post count: 1353

    Hi Michael,

    We apologize for the delay.

    Issue 1:
    The developer did an initial investigation, but couldn’t find why you would get an assert there. Unfortunately, without a test project that reproduces the issue, it will be difficult for us to investigate this issue further. You can use one of our samples as a starting point if that helps.

    Issue 2:
    Indeed, if you change the style of a header, it will touch the rest as well. If you can send us a sample project that demonstrates what you are currently doing, we can try to guide you better.

    Please send the test project(s) to support@xceed.com and include a link to this forum thread for reference. Thank you.

    Imported from legacy forums. Posted by Diane [Xceed] (had 966 views)

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