Tuesday, September 8, 2009

How to get the values of checkboxes from the checkbox list

Suppose following is the list of checkboxes in the checkbox list naming “CbPreferences” as shown,



You can get the values of the checkboxes within the above list using following code,

bool timeline, defects, processaudit, efforts, workprocessstatus;
timeline = this.CbPreferences.Items[0].Selected; // gets boolean value
defects = this.CbPreferences.Items[1].Selected;
processaudit = this.CbPreferences.Items[2].Selected;
efforts = this.CbPreferences.Items[3].Selected;
workprocessstatus = this.CbPreferences.Items[4].Selected;


Now you will be able to get the values of the checkboxes from the list of checkbox…
Always search on fukat ka gyan !!! to save your time

No comments:

Post a Comment