Feb 18, 2011, 8:50 PM
[CLOSED] Setting Checkbox value to either true or false during runtime does not work
Hi,
I'm trying to set the Checkbox value to either true or false during runtime using return values from database in code behind and it doesn't seem to work. By the way, i'm using version 0.8.2.
Sample server side code
I'm trying to set the Checkbox value to either true or false during runtime using return values from database in code behind and it doesn't seem to work. By the way, i'm using version 0.8.2.
Sample server side code
char[] seps = { ',', '\n', '\r' };
string[] WeekDays = drvSchedule["PATTERN_WEEKLY_WEEKDAYS"].ToString().Split(seps);
for (int i = 0; i < WeekDays.Length; i++)
{
foreach (Coolite.Ext.Web.Checkbox cbSelected in cbgWeekly.Items)
{
if (cbSelected.BoxLabel == WeekDays[i].Trim())
{
cbSelected.Checked = true;
}
}
}
Sample client side code <ext:CheckboxGroup
ID="cbgWeekly"
runat="server"
HideLabel="true"
ColumnsNumber="4"
AutoWidth="true">
<Items>
<ext:Checkbox ID="cbSunday" runat="server" BoxLabel="Sunday" />
<ext:Checkbox ID="cbMonday" runat="server" BoxLabel="Monday" />
<ext:Checkbox ID="cbTuesday" runat="server" BoxLabel="Tuesday" />
<ext:Checkbox ID="cbWednesday" runat="server" BoxLabel="Wednesday" />
<ext:Checkbox ID="cbThursday" runat="server" BoxLabel="Thursday" />
<ext:Checkbox ID="cbFriday" runat="server" BoxLabel="Friday" />
<ext:Checkbox ID="cbSaturday" runat="server" BoxLabel="Saturday" />
</Items>
</ext:CheckboxGroup>
Last edited by Daniil; Feb 24, 2011 at 11:06 AM.
Reason: Marked as [CLOSED]. No more information was provided.