获取数据网格的多个选定排在WPF? [英] Get the multiple selected Row in data-grid in WPF?

查看:120
本文介绍了获取数据网格的多个选定排在WPF?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想获得多重选择数据网格的WPF,因为我的业务需求我在数据网格客户表,允许多选和单选按钮(ALL,选择全部,但选定)。如果选定或全部,但选定的被点击我要拉的数据只对正在于数据库网格中选中的客户。请指点解决方案,使数据网格的多个选择行。

I want to get the multiple selection of data-grid in WPF, as my the business requirement I have a customer table in data grid which allows multiple selection and radio button (ALL, Selected, All but selected). If the selected or all but selected is clicked the I have to pull data only for those customers which are selected in the data- grid. Please advice solution to get multiple selected row of data grid.

感谢。

推荐答案

我已经得到了上述问题的解决方案,

I have got a solution for the above question,

//CustomerDTO is the DTO class which has all the column names of Customer Table.
//dgUsers is the data grid.
List<CustomerDTO> customerList ;
for (int i = 0; i < dgUsers.SelectedItems.Count; i++)
{
customerList.Add((CustomerDTO)dgUsers.SelectedItems[i]);
}

感谢。

这篇关于获取数据网格的多个选定排在WPF?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆