首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

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

2012-10-17 
WPF ListView如何知道鼠标点击了哪一列RT,现在需要对ListView上的内容进行过滤,操作员点击某行某列的内容,

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    }} 

热点排行