Hi, i have a scenario where i need to collapse the rows under a group row making it look like there is a group without any items underneath it.
I have set AutoExpandGroups to true
I created a behavior that listens to row loaded sets row visbility to collapsed in my business case but it leaves this white space around when i collapse and expand my group row.
I then modified my behavior to walk up the tree to find the first instance of GridViewVirtualizingPanel and set its visibility to collapsed. What happens here is that i still have the white space, but when i collapse and then expand the white space is gone. I have no idea why the white space wants to be there the first time but after a collapse and expand it goes away.
I was able to fix this by putting my code to set the GridViewVirtualizing panels visibility state in a Dispatcher.BeginInvoke call and the white space goes away and never comes back. The problem with this solution though is that the grid is very jumpy because for each row loaded it has a dispatcher call so they execute one at a time.
I have to use row loaded for this due to virtualization so that when a row gets re-used with a different datacontext it properly makes the panel visibile again.
Is there any way that i can do this better?
EDIT:
It would also help alot if there was a way to know when a group row itself is loaded. Is there any way to do that?
I have set AutoExpandGroups to true
I created a behavior that listens to row loaded sets row visbility to collapsed in my business case but it leaves this white space around when i collapse and expand my group row.
I then modified my behavior to walk up the tree to find the first instance of GridViewVirtualizingPanel and set its visibility to collapsed. What happens here is that i still have the white space, but when i collapse and then expand the white space is gone. I have no idea why the white space wants to be there the first time but after a collapse and expand it goes away.
I was able to fix this by putting my code to set the GridViewVirtualizing panels visibility state in a Dispatcher.BeginInvoke call and the white space goes away and never comes back. The problem with this solution though is that the grid is very jumpy because for each row loaded it has a dispatcher call so they execute one at a time.
I have to use row loaded for this due to virtualization so that when a row gets re-used with a different datacontext it properly makes the panel visibile again.
Is there any way that i can do this better?
EDIT:
It would also help alot if there was a way to know when a group row itself is loaded. Is there any way to do that?