I want to change the color on a row. So basically. I get a from my Web Service with the names of all my admins. And I want to compare that list to the information in my datagridsource. And if they are admins I want their rows to turn red.
void proxy_GetListOfAdminsInGroupCompleted(object sender, gkws.GetListOfAdminsInGroupCompletedEventArgs e)
{
TestlistBox1.ItemsSource = e.Result;
int i = 0;
foreach (var item in UsersInSelectedGroup[0])
{
foreach (var admin in e.Result)
{
if (admin.ToString().Equals(item.ToString()))
{
//Code to change the color of the row where "admin.ToString().Equals(item.ToString())"
}
}
i++;
}
}
Thanks!
I created a sample CustomClass:
Created a list:
Then created the Datagrid:
Then the resources:
and this is for the converter:
It basically gets and sets the solidcolorbrush based on the property “PropertyToBeWatched”.
Hope this helps