This is a migrated thread and some comments may be shown as answers.

How to bind CheckBoxList in GridView

1 Answer 92 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tan
Top achievements
Rank 1
Tan asked on 05 Dec 2012, 10:54 AM
i have **GridView** have one column is **CheckBoxList(Mon, Tues, Wed, Thur, Fri, Sat, Sun)**



Data for selected Week:

 - "1101000" mean (Mon, Tues, Thur is selected)  
 - "1000000" mean (Mon is selected)  
 - "0100000" mean (Tues is selected)

Below is use to identify the selected item

                Boolean isMonday = false;
                Boolean isTuesday = false;
                Boolean isWednesday = false;
                Boolean isThursday = false;
                Boolean isFriday = false;
                Boolean isSaturday = false;
                Boolean isSunday = false;

                if (alertDayInt >= 1000000)
                {
                    isMonday = true;
                    alertDayInt -= 1000000;
                }
                else if (alertDayInt >= 100000)
                {
                    isTuesday = true;
                    alertDayInt -= 100000;
                }
                else if (alertDayInt >= 10000)
                {
                    isWednesday = true;
                    alertDayInt -= 10000;
                }
                else if (alertDayInt >= 1000)
                {
                    isThursday = true;
                    alertDayInt -= 1000;
                }
                else if (alertDayInt >= 100)
                {
                    isFriday = true;
                    alertDayInt -= 100;
                }
                else if (alertDayInt >= 10)
                {
                    isSaturday = true;
                    alertDayInt -= 10;
                }
                else if (alertDayInt >= 1)
                {
                    isSunday = true;
                    alertDayInt -= 1;
                }

1 Answer, 1 is accepted

Sort by
0
Tan
Top achievements
Rank 1
answered on 06 Dec 2012, 10:08 AM
Solve.
Tags
Grid
Asked by
Tan
Top achievements
Rank 1
Answers by
Tan
Top achievements
Rank 1
Share this question
or