Hi, I hope you can help
in my project I am representing some data for a user as per screen shot
This data is grouped on 2 columns (Virtual Shift, which is a date time range from to) and Name , which is a name as shown POS Manager, RRV1 etc
When I have been adding/removing items from the data source I have to do a refresh a force a re-read from the database. this causes the grid to rebuild and consequently loose the topindex and selected row. I have dealt with this as I did with another grid from a previous support ticket.
Now
my issue is that , if the groups are all expanded then everything is fine, the reset of the top index and focused row handle works fine and the grid is shown correctly , however , if any groups are collapsed It fails to work due to the collapsed rows .
So I started to look into determining which rows are collapsed so I can collapse them after the reload of the data and before I reset the focused row handle.
My issue is this
The row count changes when you collapse rows… and as such m the collapsed rows are not part of the rowcount anymore!
when all rows are visible I have 155 in the rowcount (these represent 120 actual data rows + the group header rows…
when I collapse the top level group row with the shift , I check the rowcount and now its a 3rd less so I can tell by this the rows not visible are no longer in the row count
If I collapse all I see a row count of 3!!
I found an example that shows how to determine group rows and if all are collapsed etc and this example uses the rowcount to determine the loop. this will never work
How should I determine what rows are collapsed (even a loop for 5000 rows does not work because IsGroupRow and GetRowExpanded does not appear to work.
What am I doing wrong ?
In summary I need to reset the collapsed state of the groups after reloading (I need to record the state before reload and then re-apply this state)
If I collapse ALL while row count shows 3 , the IsGroupRow(0) or 1 or 2 still all return False! when I would of expected True