i have done a problem two:
+ In Rowheadtemplate i add togglebutton. I want to change color backgoround of togglebutton when value of one of the cell is "online":
private void Button_Click_2(object sender, RoutedEventArgs e)
{
for (int i = 0; i < dataGrid1.Items.Count; i++)
{
DataGridRow row = (DataGridRow)dataGrid1.ItemContainerGenerator.ContainerFromIndex(i);
FrameworkElement tb = GetTemplateChildByName(row, "RowHeaderToggleButton");
if (((TextBlock)dataGrid1.Columns[1].GetCellContent(dataGrid1.Items[i])).Text == "Online")
{
ToggleButton tgb = (ToggleButton)tb;
tgb.Background = Brushes.Blue;
}
}
}
The first remaining issue.Can you have me a solution? thank you so much.