当我执行下面的代码时,我得到了 NullReferenceException。
private void Move(bool isRight)
{
SaveSelected();
// Move the selected items over
for (int index = 0; index < this.DataSource.Rows.Count; index++)
{
DataRow row = this.DataSource.Rows[index];
if (isRight && (bool)row["IsSelected"] == true &&
(bool)row["HasResult"] == false ||
!isRight && (bool)row["IsSelected"] == false)
{
// move it by setting a flag which is used by the view
row["LeftSide"] = !isRight;
}
}
this.BindData(EventArgs.Empty);
}
请给我一个解决方案。
谢谢,尼兰詹