WPF DataGrid programmatic multiple row selection
Posted
by MicMit
on Stack Overflow
See other posts from Stack Overflow
or by MicMit
Published on 2010-03-23T00:35:18Z
Indexed on
2010/03/23
0:41 UTC
Read the original article
Hit count: 805
wpf
|wpfdatagrid
Is there anything simpler than sample below ? I do have observable collection ( "list" in the code ) bound to DataGrid lstLinks
for (int i = 0; i < list.Count ; i++)
{
object rowItem = lstLinks.Items[i] ;
DataGridRow visualItem = (DataGridRow)lstLinks.ItemContainerGenerator.ContainerFromItem(rowItem);
if (list[i].Changed)
visualItem.IsSelected = false;
else
visualItem.IsSelected = false;
}
© Stack Overflow or respective owner