我试图在网格中迭代时只获取子模板的数据。
我从以下内容开始:
foreach (GridViewRowInfo row in radGridView1.Rows)
{
err = IterateChildRows(row);
}
并将该行传递给:
private bool IterateChildRows(GridViewRowInfo rowInfo)
{
bool err = false;
if (rowInfo.Cells[5].Value != null && rowInfo.Cells[5].Value.ToString() != "01/01/1900")
{
if (rowInfo.Cells[0].ViewTemplate.Templates[0].Caption == "Current")
{
if (rowInfo.ViewTemplate.Templates[0].RowCount == 0)
{
MessageBox.Show("Not all products have CURRENT quantity breaks", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
err = true;
}
}
}
return err;
}
我的问题是,我似乎找不到我传递的行的子模板数据。我所尝试的一切似乎都有来自所有主模板项的所有子行,而不仅仅是我传递的行。
因此,如果我在主网格中有2个项目,在子模板中各有3个项目,那么我得到的计数是6而不是3。
我不知道我哪里出错了。。。
任何人
干杯
院长