简体   繁体   English

Xamgrid刷新或重新应用过滤器

[英]Xamgrid refresh or reapply filters

Is there some way to reapply the filter without having to reselect the filter? 是否有某种方法可以重新应用过滤器而不必重新选择过滤器? Especially when the underlying observable collection is changed? 尤其是当基础可观察集合发生变化时? I seem to have records which don't match the filter condition after a while.. 一段时间后,我似乎有不符合过滤条件的记录。

The XamGrid doesn't have a method to refresh. XamGrid没有刷新方法。 The INotifyCollectionChanged events are supposed to handle updating the grid accordingly. INotifyCollectionChanged事件应该处理相应的网格更新。

You could try programmatically removing the current filters that are set and then readd them. 您可以尝试以编程方式删除当前设置的过滤器,然后读取它们。 It's a little tough for me to know if this will solve your issue though as I don't have a sample that reproduces the issue. 尽管我没有重现此问题的样本,但我很难知道这是否可以解决您的问题。

You could also try deriving from ObservableCollection and implement a refresh method. 您也可以尝试从ObservableCollection派生并实现refresh方法。 Inside the refresh method you could call OnCollectionChanged and pass in a Reset action. 在refresh方法内部,您可以调用OnCollectionChanged并传递一个Reset动作。 This might refresh the XamGrid. 这可能会刷新XamGrid。

您可以尝试调用XamGrid类的InvalidateData方法-应该使所有数据操作(如分组,排序和过滤)无效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM