Alternate rows styles in DataGridView

0
0

I’ve got an application, ported from VWG.  On one page, I have two DGVs, one of which displays an alternating row style and the other does not.

I’ve read https://wisej.com/support/question/alternate-row-style-in-datagridview which mentions that a theme or theme mixin can control these styles – I have no themes or mixins in my project, and no file in my solution at all mentions the styles named in that article (e.g., “table-row-background-even”).

So, why does one grid honor the style (which must be set by the built-in theme, I’m assuming) while the other does not? The grid that does not honor the alternate style actually appears to have no style at all – selected rows are painted exactly the same as unselected rows.

WiseJ 3.5.5

Windows 11, Edge browser

  • You must to post comments
0
0

This had something to do with styles & other content leftover from the VWG designer that the WiseJ designer carried forward.   I removed all cell styles from the grids and then re-added the appropriate style and the grid started working correctly.  I don’t know exactly what it was – I fiddled with it for hours, cleaning up junk in the .designer.cs file until it started working.

  • You must to post comments
0
0

Hello Carl,

To answer your questions, every Wisej.NET component can be customized using Themes or Mixins.

A mixin basically overrides all instances of a deisgnated control, it would appear exactly the same across any theme you choose.

Either that, or you can have a custom theme tailored to your needs.

The default themes could be found under Documents/Wisej/Themes.

Every component has a default AppearanceKey that could be set to a custom one, for example you can have an appearance of a button (default is “button”) and have one that’s called “buttonOK”, in this case you can use that appearance one time instead of multiple.

For better information about the theming capabilities of Wisej.NET, please head over to https://docs.wisej.com/theme-builder

As for your other question:
“So, why does one grid honor the style (which must be set by the built-in theme, I’m assuming) while the other does not? The grid that does not honor the alternate style actually appears to have no style at all – selected rows are painted exactly the same as unselected rows.”

We can’t know for sure unless you provide us with a small runnable sample.

Best regards,
Alaa

 

//

  • Carl Daniel
    Let me see what I can find based on the information you’ve given. As with the other ticket I opened a few moments before this one, I rather suspect that a small repro will not be possible – literally every grid I have except for this one is behaving correctly, so there must be something about this particular grid.
  • Carl Daniel
    AppearanceKey on the DGV that’s not reflecting the theme is null. AppearanceKey on the DGV that IS reflecting the theme is also null, so it’s not that. Theme is the built-in “Classic-2”.
  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.