简体   繁体   English

在Entity Framework中优雅地过滤DataGrid(WPF)

[英]Elegant filtering of DataGrid (WPF) in Entity Framework

I want this scenario: 我想要这个场景:

  1. Using Entity Framework bind the DataGrid (WPF) to some collection of entities. 使用Entity Framework将DataGrid(WPF)绑定到某些实体集合。
  2. Now, I would like to have one TextBox for each column and filter the rows online as user changes the TextBoxes' content. 现在,我希望为每个列都有一个TextBox,并在用户更改TextBoxes的内容时在线过滤行。

So, specifically, data is loaded and bound only once. 因此,具体而言,数据仅加载和绑定一次。 There would be around 1000 rows. 将有大约1000行。

Thank you in advance! 先感谢您! James 詹姆士

you could use ICollectionView.Filter to create your own filter. 您可以使用ICollectionView.Filter创建自己的过滤器。

look at this or this . 看看这个还是这个

I know I may not be answering to your requirement directly but this may be of some help to you or your organization. 我知道我可能不会直接回答您的要求,但这可能对您或您的组织有所帮助。 Instead of developing something from scratch, you can use something that is already developed and tested. 您可以使用已经开发和测试过的东西,而不是从头开始。 Have a look at DevExpress DxGrid or Filtering page here 这里查看DevExpress DxGrid或Filtering页面

Hope that helps. 希望有所帮助。 I have DevExpress controls in past and they are really awesome 我过去有DevExpress控件,它们真的很棒

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

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