【问题标题】:how to add a textbox to each header column of a Gridview and filter that column using the textbox?如何将文本框添加到 Gridview 的每个标题列并使用文本框过滤该列?
【发布时间】:2012-04-27 00:06:37
【问题描述】:

我需要在 DataGrid 的每列标题中添加一个文本框并使用此文本框过滤该列吗? 我使用这篇文章将文本框添加到列标题,但我不知道如何将它们绑定到 Viewmodel? Datagrid custom header

【问题讨论】:

    标签: wpf mvvm mvvm-light wpfdatagrid


    【解决方案1】:

    您可以创建自定义类来表示您的可过滤标头,然后您可以将额外的可过滤标头集合放入您的视图模型中,这样您将公开两个集合 - 一个用于实际数据,一个用于标头绑定,然后绑定它.你也可以检查这个:WPF Datagrid binding custom column headers

    【讨论】:

      猜你喜欢
      • 2018-03-14
      • 1970-01-01
      • 2014-11-17
      • 1970-01-01
      • 1970-01-01
      • 2019-05-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多