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
435
Event to clear the Grid settings
posted

I have a xamDataGrid which is bound property from my View Model layer. My requirement is to to clear the sort and filter whenever data is refreshed.

I know putting these two lines would do it for me, I am trying to find which event I should put this code. Currently I have put these in DataGrid_DataContextChanged, but this event fires only for the first time, I want to know which event fires whenever data is rebinded (through property in my ViewModel).

 Me.ClearCustomizations(CustomizationType.GroupingAndSorting) 

Me.ClearCustomizations(CustomizationType.RecordFilters)

Any quick help is appreciated.

Parents
No Data
Reply
  • 138253
    Suggested Answer
    Offline posted

    Hello Tusky,

    Thank you for your post. I have been looking through it and I suggest you use InitializeRecord event if you want to clear sort and filter every time you add new record or change some property of the existing ones. If you want to clear them only when you change the DataSource or DataContext you can use the FieldLayoutInitialized event, but before you set them to new instances you can clear the FieldLayouts to ensure that the event will fire. Please note, we are making effort to ensure that all forum posts are answered by an Infragistics expert. We believe that the other community member could benefit from this thread as well.

    If you have any further questions fell free to ask.

Children
No Data