开发者

WPF datagrid multiple row selection

开发者 https://www.devze.com 2023-04-05 21:33 出处:网络
I have a customcontrol similar to wpf datagrid. I need to select the multiple rows and开发者_高级运维 get the column values of all the selected rows. Could anyone help to solve this.We need a bit more

I have a customcontrol similar to wpf datagrid. I need to select the multiple rows and开发者_高级运维 get the column values of all the selected rows. Could anyone help to solve this.


We need a bit more information for the question, but you could look at LINQ? Maybe you can work with this:

    List<int> rows = new List<int>{1,2,3};

    var values = from row in datagrid
                 where rows.Contains(row.Select(e => e.rowindex))
                 select new { Value = row.value };
0

精彩评论

暂无评论...
验证码 换一张
取 消