Get checkbox value and store in IList
Need some help since I'm still a newbie in programming. I have a gridview
that has five columns, the three columns composed of checkboxes. Then I
need to get these checkboxes value if they were checked and put it in
IList. My problem is how to implement it when adding it to my IList.
Please help. See my code below. I know something is wrong.
public IList<Title> Checkboxes
{
get
{
CheckBox chkEPS;
CheckBox chkIMDF;
CheckBox chkPS;
IList<Title> checkedList = new List<Title>();
foreach (GridViewRow row in gvwTitles.Rows)
{
chkABC = (CheckBox)row.FindControl("chkABC");
chkABCD = (CheckBox)row.FindControl("chkABCD");
chkABCDE = (CheckBox)row.FindControl("chkABCDE");
if ((chkABC.Checked) && (chkABCD.Checked) && (chkABCDE.Checked))
{
checkedList.Add(new Title(What will be the value));
// how will I add the value, I am also considering what if
the user check the chkABC checkbox, while the others were
not checked??
}
}
return checkedList;
}
}
public Title(int id, bool _isPocketSharing, bool _isPreventSplitting, bool
_isMissingDataFile)
No comments:
Post a Comment