My purpose is to remove a specific Row..
The source below runs the entire For statement from for (int i = 0; i < listNoAssign.Items.Count; i++) to listNoAssign.Items.Count .
In the meantime, it has been removed,
for (int i = 0; i < listNoAssign.Items.Count; i++) Here's the problem.
The source below runs the entire For statement from for (int i = 0; i < listNoAssign.Items.Count; i++) to listNoAssign.Items.Count .
In the meantime, it has been removed,
for (int i = 0; i < listNoAssign.Items.Count; i++) Here's the problem.
C#:
for (int i = 0; i < listNoAssign.Items.Count; i++)
{
CheckBox chk = this.listNoAssign.Items[i].FindControl("chkSELECT") as CheckBox;
if (chk.Checked == true)
{
listNoAssign.Items.RemoveAt(i);
}
}
this.listNoAssign.DataSource = NoAssignInfoList;
this.listNoAssign.DataBind();
ViewState["NoAssignInfoList"] = NoAssignInfoList;