Get the multiple selected Row in data-grid in WPF?

后端 未结 2 692
孤城傲影
孤城傲影 2021-01-06 11:18

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 butto

2条回答
  •  长发绾君心
    2021-01-06 11:26

    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 customerList ;
    for (int i = 0; i < dgUsers.SelectedItems.Count; i++)
    {
    customerList.Add((CustomerDTO)dgUsers.SelectedItems[i]);
    }
    

    Thanks.

提交回复
热议问题