Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
230
Changing the default font for rows in an UltraGrid on the fly at Run-time
posted

I am having difficulty determining how to set the default font for rows in an UltraGrid on the fly at runtime.  Is this possible and if so, how?

I can change it during initialization using the Font property, but that changes everyrow, even headers and only works prior to the grid being initialized.  I need something that works dynamically, in response to user input, for example.

Thanks,

Doug

Parents
No Data
Reply
  • 2070
    posted

     Hi Doug,

     

    You can do this by hooking into InitializeRow event of the grid and initialize the row.Appearance based on your criteria.

    Also note that if your app has a lot of rows, then it's probably a good idea for performance reasons to create separate Appearance objects  and assign them to the row's Appearance property. As an example

    Appearance blueApp, redApp;

    // init above appearances.

     // in InitializeRow event handler, assign the row's Appearance to whichever appearance object is applicable to the row based on your criteria.

     e.Row.Appearance = blueApp;

     

    This will greatly reduce memory overhead since the same blue or read appearance object will be  shared across multiple rows.

     

    Sandip 

Children