读书人

WPF ListView怎么知道鼠标点击了哪一列

发布时间: 2012-10-17 10:25:46 作者: rapoo

WPF ListView如何知道鼠标点击了哪一列
RT,现在需要对ListView上的内容进行过滤,操作员点击某行某列的内容,然后将该列不等于所点击的内容的行删除掉。

请问如何知道鼠标点击的是第几列??

麻烦大家帮帮忙!!

[解决办法]

C# code
public class ProductViewModel{    private IProductModel _model;    public ICollectionView EntityListView { get; private set; }    [ImportingConstructor]    public ProductViewModel(IProductModel model)    {        this._model = model;        EntityListView = CollectionViewSource.GetDefaultView(_model.GetProducts());        if (EntityListView != null)        {            EntityListView.CurrentChanged += OnEntityListViewChanged;        }    }    private void OnEntityListViewChanged(object sender, EventArgs e)    {        // TODO: add your code here    }} 

读书人网 >C#

热点推荐