111,098
社区成员




var row = dataGrid.ItemContainerGenerator.ContainerFromItem(dataGrid.Items[i]) as DataGridRow;
this.dgList.LoadingRow += new EventHandler<DataGridRowEventArgs>(dgList_LoadingRow);
void dgList_LoadingRow(object sender, DataGridRowEventArgs e)
{
int index = e.Row.GetIndex();
if (index % 2 == 0)
{
e.Row.Background = Brushes.Gray; // color
}
else {
e.Row.Background = Brushes.Yellow;
}
//e.Row.Header = index + 1;
}