WPF datagrid怎么只设置某一行的高度
private void citydata_LoadingRow(object sender, DataGridRowEventArgs e)
{
//Console.WriteLine(e.Row.GetIndex());
//Console.WriteLine((citydata.Items[e.Row.GetIndex()] as MyCityRank).rank);
if ((e.Row.Item as MyCityRank).rank <= 0)
{
Console.WriteLine(e.Row.GetIndex());
Console.WriteLine((e.Row.Item as MyCityRank).rank);
e.Row.Height = 2;
e.Row.IsEnabled = false;
}
}
设置某一行高度后(只想把rank=0的第二行调整),再滚动滚动条会出现其他行也被调整高度了,这是怎么回事,只有第二行的rank是等于0的,其他的都大于0