View Full Version : [CLOSED] Get Checked items of checkbox group

Oct 21, 2013, 3:59 PM
Hi Team,

We are working on checking checkbox group items from code behind and suspending its events, we are doing that by calling javascript function.
It is working fine up to checking. But when we are trying to get the checked items in another event the checkbox group is returning zero as count

We summarized the code to reproduce the issue. But actual scenario is while loading usercontrol we are doing checking. And in another button event we are trying to get the checked items.
How can we achive this functionality?

Here is the code to reproduce the issue

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CheckGroup.aspx.cs" Inherits="Ext2._2Practice.CheckGroup" %>

<%@ Register Namespace="Ext.Net" Assembly="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<script type="text/javascript">
var SetCheckBoxCheckValues = function (radio, isChecked) {
if (radio) {
<script runat="server">
protected void Page_Load(object sender, EventArgs e)

protected void btnSet_OnEvent(object sender, DirectEventArgs e)
ResourceManager1.AddScript("SetCheckBoxCheckValues(" + chkSunday.ClientID + "," + true.ToString().ToLower() + ");");
protected void btnGet_OnEvent(object sender, DirectEventArgs e)
List<string> lstSelectedDays = new List<string>();

chkGroupWeekDaysOption.CheckedItems.ForEach(delega te(Checkbox checkbox)
int count = lstSelectedDays.Count;
<form id="form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:FieldContainer ID="fcWeekDaysOptions" Padding="50" runat="server" LabelWidth="120" LabelAlign="Left" FieldLabel="Occurence Days">
<ext:CheckboxGroup Width="350" ID="chkGroupWeekDaysOption" runat="server"
<ext:Checkbox ID="chkSunday" runat="server" BoxLabel="Sunday" />
<ext:Checkbox ID="chkMonday" runat="server" BoxLabel="Monday" />
<ext:Checkbox ID="chkTuesday" runat="server" BoxLabel="Tuesday" />
<ext:Checkbox ID="chkWednesday" runat="server" BoxLabel="Wednesday" />
<ext:Checkbox ID="chkThursday" runat="server" BoxLabel="Thursday" />
<ext:Checkbox ID="chkFriday" runat="server" BoxLabel="Friday" />
<ext:Checkbox ID="chkSaturday" runat="server" BoxLabel="Saturday" />
<ext:FieldContainer ID="FieldContainer1" Padding="50" runat="server" LabelWidth="120" LabelAlign="Left" FieldLabel="Occurence Days">
<ext:Button ID="btnSet" runat="server" StyleSpec="margin-right:50px;" Text="Set">
<Click OnEvent="btnSet_OnEvent"></Click>
<ext:Button ID="btnGet" runat="server" Text="Get">
<Click OnEvent="btnGet_OnEvent"></Click>

Please contact if you need more information

Oct 21, 2013, 5:02 PM
Hi @mohan.bizbites,

Please call

after the setValue call.