This is a migrated thread and some comments may be shown as answers.

RadGridView - How to refresh RowDetailsTemplate rows?

1 Answer 241 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Craig
Top achievements
Rank 1
Craig asked on 31 Oct 2017, 08:06 PM

I'm using RadGridView with RowDetailsTemplate. I'm using the MVVM Light toolkit and everything works fine with updating values in the RowDetails if I were to click a button in the parent row. RaisePropertyChanged works great, values in the RowDetail updates as expected. The problem I'm seeing and I don't think this control is going to work how I'd like to is what if I click a button in the parent row that changes the number of rows in the RowDetailsTemplate. I change the collection that the RowDetailsTemplate is bound to but it's not redrawing correctly. Instead of displaying the new set of rows it just deletes all rows and ends there. Is there a way to force the RowDetailsTemplate to redraw? I read somewhere that the LoadingRowDetails event is only raised once but in this case, changing the collection should be enough to force the detail rows to redraw. Or at least that's what I would think.

Thanks

Craig

1 Answer, 1 is accepted

Sort by
0
Craig
Top achievements
Rank 1
answered on 01 Nov 2017, 01:17 PM
I figured it out on my own. You need to use ObservableCollection instead of a generic List for you RowDetail collection. The grid must be aware of changes to that type of collection as long as your call a RaisePropertyChange on that collection when it changes.
Tags
GridView
Asked by
Craig
Top achievements
Rank 1
Answers by
Craig
Top achievements
Rank 1
Share this question
or