I have Two Check Box one is Check Box and Another one is checkbox List it working properly while adding value of checkbox list but while updating value of check box it show me error of "Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index" I am not getting why this error show Here my code
if (e.CommandName == "EditShift")
{
string[] arg = e.CommandArgument.ToString().Split('$');
ddlShiftname.Text = arg[0];
txtstarttime.Text = arg[1];
txtendtime.Text = arg[2];
ddlIndicator.Text = arg[3];
string iRefNo = arg[4];
titlename.InnerText = "Update Shift Management";
btnAddShift.Text = "Update shift";
DataTable dtShiftManage = new DataTable();
dtShiftManage = objShift.GetShiftByRefNo(iRefNo);
foreach (DataRow dr in dtShiftManage.Rows)
{
ChkDays.Items[Convert.ToInt32(dr["WeekDay"])].Selected = true;
}
}
please help me out from this !!