I have a gridview that contains a list of objects. It has a rowdetails template so that each row can be expanded to show an extra panel with more details.
Now I need to be able to change the details-visibility for a single row (or multiple if I choose) from code.
I have tried looping over all the rows in the grid and then calling DetailsVisibility = Visibility.Collapsed (or expanded) on each of them.
This gives me a weird result because it doesn't appear to be working for all rows. I get the impression that it only works for those that are visible at the time the code is called.
If I have a grid full of expanded rows (so that there are a number of them that aren't visible unless you scroll down)...and then execute the code to collapse all the rows in the grid... Then it doesn't work for all of the rows. Some of them remain expanded... Then I click again and some more rows collapse, and I have to keep clicking several times, each time closing some extra rows.
This looks very strange because the code _myGridviewRow.DetailsVisibility = Visibility.Collapsed is called on each row but it really looks like it doesn't affect the rows that are offscreen at that moment.
I would expect the property-change to have taken effect then when they come back into view, but it doesn't.
Does anyone know of a solution to this problem? I just need to be able to programmatically expand or collapse the details of an individual row (or a couple of rows that I choose) from the code-behind.
Now I need to be able to change the details-visibility for a single row (or multiple if I choose) from code.
I have tried looping over all the rows in the grid and then calling DetailsVisibility = Visibility.Collapsed (or expanded) on each of them.
This gives me a weird result because it doesn't appear to be working for all rows. I get the impression that it only works for those that are visible at the time the code is called.
If I have a grid full of expanded rows (so that there are a number of them that aren't visible unless you scroll down)...and then execute the code to collapse all the rows in the grid... Then it doesn't work for all of the rows. Some of them remain expanded... Then I click again and some more rows collapse, and I have to keep clicking several times, each time closing some extra rows.
This looks very strange because the code _myGridviewRow.DetailsVisibility = Visibility.Collapsed is called on each row but it really looks like it doesn't affect the rows that are offscreen at that moment.
I would expect the property-change to have taken effect then when they come back into view, but it doesn't.
Does anyone know of a solution to this problem? I just need to be able to programmatically expand or collapse the details of an individual row (or a couple of rows that I choose) from the code-behind.