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
785
Custom Cellbackground and AlternateRowCellBackground for a Custom IGGridViewColumnDefinition
posted

Hi - I've implemented a custom theme for my grid to fit styling of the design that is requested. I've done so easily by using the gridView.Theme = new myCustomGridViewTheme();

Of course in my theme i implement IGGridViewThemeDefinition and override the properties I want, specifically, CellBackgroundColor and AlternateRowCellBackground.

My issue is though when I implement a custom IGGridViewColumnDefinition to do things like Date Formatting and what not the Theme is not appearing on these custom columns. 

How can I get the theme to appear on these custom columns? I can easily set the cell Background in the custom cell, but the Alternate Cell Background I'm not seeing how to do that. What might be the best approach?

Thanks in advance.

Parents
No Data
Reply
  • 40030
    Verified Answer
    Offline posted

    Hi!

    In the column definition all we're doing is detecting if the cell's row index is odd or even, and setting the cell's background color to either alternate or not using the theme. 

    Where odd is alternate and even is not alternate. 

    However, you don't really have to worry about that, in your column definition, before your return a cell in CreateCell, simply call ApplyStylingToCell. That will automatically pull all the styling information from the column and theme and apply it to the cell for you. 

    -SteveZ

Children
No Data