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
105
Grouped-By rows and appearance change
posted

Hi,

I have a problem with a WinGrid (NetAdvantage 2007) :

I have rows, that are grouped by one or more fields.
At the beginning all groups are collapsed. I expand manually some of them.

Then I have a function that changes the aspect of some rows based on rules :
row.Appearance.BackColor = System.Drawing.Color.White;
row.Appearance.BackColor2 = System.Drawing.Color.DarkGray;
row.Appearance.BackHatchStyle = BackHatchStyle.BackwardDiagonal;

The problem is that when the appearances are applied, all groups get collapsed again.
I want them to remain in the same state (expanded or collapsed) as they were before the "appearance change"...


Is it a bug ? It may have been corrected in newer versions of NetAdvantage, but I cannot just update my version, I'm stuck with the 2007 one...
I image I could check the state of each group, store it somewhere, apply my appearances, and then restore the state of each group afterwards, but it seems like too much to do for this...

Thanks in advance,
Philippe.

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    Hi Philippe,

    There's no way that setting an appearance could ever cause a row to be collapsed. I suspect there must be some other peice of code that is doing this.

    Most likely, you are doing something which is causing your grid's DataSource to send a Reset notification which means that the grid has to throw away all of the rows and create new ones based on the new data.

    The only way around that is to either avoid the reset, or try to store the state of the grid rows before the reset and then restore it afterward. But without knowing exactly what you are doing, it's hard to offer you any more useful advice.

Children