1 private void SetSelectIndex(List<int> listIndex) 2 { 3 try 4 { 5 foreach (var i in listIndex) 6 { 7 if (i >= datagridSig.Items.Count) 8 continue; 9 10 DataGridRow row = (DataGridRow)datagrid.ItemContainerGenerator.ContainerFromIndex(i); 11 row.IsSelected = true; 12 } 13 } 14 catch (Exception ex) 15 { 16 17 } 18 }
标签:多行,listIndex,DataGrid,WPF,row,DataGridRow From: https://www.cnblogs.com/ppcc/p/18165793