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
2549
CellAppearance problem with WinGrid when removing entry from datasource
posted

Hi all,
I am currently facing a strange problem with the WinGrid.
It is a standard WinGrid, bound to an object datasource (List<item>).
I added an UnboundColumn to display a "light" icon that indicates its status (red, green).
On InitializeRow the calculation is done and a predefined (for reuse) Appearance is assigned to the cell (unbound column).
Now imagine the following rows (Id, IndicatorImage):
1     green
2     green
3     red
4     red

now if I remove the data entry from the datasource that contains Id = 2 I assumed to have the following rows:
1     green
3     red
4     red

Unfortunately I get this:
1     green
3     green
4     red

It seems that the indicator image stays the same for the rows (the bottom one is removed though)

Any hint is kindly appreciated,
best regards
Andy 

Parents
  • 469350
    Offline posted

    Hi Andy,

    Can you post your InitializeRow code so I can see what it's doing? It seems to me that, since the color on the existing row is changed, the InitializeRow must be firing for that row and the InitializeRow code must therefore be applying the wrong Appearance to the row.

    Also, what version of the grid are you using? It's also possible that this is a bug in a very old version of the grid where it's re-using the UIElements incorrectly. But that bug was fixed many years ago.

Reply Children