views:

68

answers:

0

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 ( visualItem == null ) break;  
    if (list[i].Changed)
        visualItem.IsSelected = false;
    else
         visualItem.IsSelected = false; 

}