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
80
InvalidateData on subroot level
posted

Hi,

Could you please help me with XamGrid.InvalidateData ?

I have Hierarchical grid:

RootItem1
  - Sub Items... <-- I can set GroupBy to those.
RootItem2....

I'm raising xamGrid.InvalidateData(true) when grid viewModel updates - but this procedure also is resetting groups collapse/expand state in all items.

Is there a way to InvalidateData on subitems of only specific RootItemX node (expecting that groups in other RootItems would preserve correct state)?

Parents
  • 34510
    Offline posted

    Hi Nikita,

    InvalidateData only exists on the XamGrid itself so there's no way to use it on just a sub section of rows instead.  And that method causes sorting and groupby operations to be invalidated which is why the expansion state is lost when you call this.

    Is it really necessary to call InvalidateData when your view model updates?  What kind of view model update are you performing that requires the InvalidateData method?  INotifyPropertyChanged and INotifyCollectionChanged are fully supported by the control so there's usually no reason to call that method if you need to update the XamGrid to show changes in the underlying data.

Reply Children