wpf中DataGrid遍历行问题
datagrid的每行列头有个checkbox ,我想遍历DataGrid选中的行,我用getcellContent好多数据都遍历不到
代码
for (int i = 0; i < DataGridDiskList.Items.Count; i++)
{
CheckBox chk = DataGridDiskList.Columns[0].GetCellContent(DataGridDiskList.Items[i]) as CheckBox;
if (chk!=null)
{
if (chk.IsChecked.Value)
{
System.Windows.Forms.MessageBox.Show("not null");
}
//else
// ++noCheck;
//++full;
}
else
{
System.Windows.Forms.MessageBox.Show("null");
//++blank;
}
}