[CLOSED] [1.0] Unable to get values of the Radiogroup CheckedItems inside an usercontrol

  1. #1

    [CLOSED] [1.0] Unable to get values of the Radiogroup CheckedItems inside an usercontrol

    Hi,

    I am unable to get the checkeditems values of the radiogroup which is placed inside an user control. This is my scenario,

    I have an usercontrol "Sample.ascx" which has radiogroup items and using the usercontrol inside an aspx page ("Sample.aspx"). But I am unable to get the values of the checkeditems of the radiogroup..

    The CheckedItems.Count is always "0". Below is my samples.

    1. Sample.ascx

    <%@  control language="vb" autoeventwireup="false" codebehind="SampleControl.ascx.vb"
        inherits="Zangle.NET.SampleControl" %>
    <%@ register assembly="Ext.Net" namespace="Ext.Net" tagprefix="ext" %>
    <ext:Panel runat="server" Border="false" Header="true" Title="Select Enrollment Criteria">
        <Items>
            <ext:Container ID="Container1" runat="server">
                <Items>
                    <ext:RadioGroup ID="rgpEnroll" runat="server" ColumnsNumber="1" Cls="radioBorder">
                        <Items>
                            <ext:Radio ID="rdbtnActive" runat="server" BoxLabel="Active Students" Checked="true">
                            </ext:Radio>
                            <ext:Radio ID="rdbtnThisYear" runat="server" BoxLabel="This Year Students">
                            </ext:Radio>
                            <ext:Radio ID="rdbtnFuture" runat="server" BoxLabel="Future Students">
                            </ext:Radio>
                            <ext:Radio ID="rdbtnInActive" runat="server" BoxLabel="Inactive Students">
                            </ext:Radio>
                            <ext:Radio ID="rdbtnAll" runat="server" BoxLabel="All Students" Visible="false">
                            </ext:Radio>
                        </Items>
                    </ext:RadioGroup>
                </Items>
            </ext:Container>
            <ext:Checkbox runat="server" ID="chkExPart" BoxLabel="Exclude Part-time Students">
            </ext:Checkbox>
        </Items>
        <Buttons>
            <ext:Button runat="server" ID="btnDone" Text="Select">
                <DirectEvents>
                    <Click OnEvent="SaveClick">
                        <EventMask Msg="Saving..." ShowMask="true" />
                    </Click>
                </DirectEvents>
            </ext:Button>
        </Buttons>
    </ext:Panel>
    2. Sample.ascx.vb

    Imports Ext.Net
    Partial Public Class SampleControl Inherits System.Web.UI.UserControl
        <DirectMethod()> _
        Public Sub SaveClick()
            If (rgpEnroll.CheckedItems.Count > 0) Then
                If rdbtnActive.Checked Then
                'do something
                End If
    
                If rdbtnThisYear.Checked Then
                'do something
                End If
            End If
        End Sub
    End Class
    3. Sample.aspx

    <%@ page language="vb" autoeventwireup="false" codebehind="Sample1.aspx.vb" inherits="Zangle.NET.Sample1" %>
    
    <%@ register assembly="Ext.Net" namespace="Ext.Net" tagprefix="ext" %>
    <%@ register src="SampleControl.ascx" tagname="SampleControl" tagprefix="uc2" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Untitled Page</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <ext:ResourceManager ID="RMSearch" runat="server" InitScriptMode="Linked" />
        <ext:Panel runat="server" ID="pnlCritCtrl" Height="295" Width="480" Frame="false"
            StyleSpec="margin-left:5px;margin-right:5px;" Border="true">
            <Content>
                <uc2:SampleControl ID="SampleControl1" runat="server" />
            </Content>
        </ext:Panel>
        </form>
    </body>
    </html>
    Can you tell us, what is wrong with our code..

    Thanks
    Last edited by geoffrey.mcgill; Jul 08, 2010 at 6:03 PM. Reason: Formatted users code sample to improve readability
  2. #2
    Please edit your last post adding proper line tab/indentation and wrap all code samples in [CODE] or [html] tags.
    Geoffrey McGill
    Founder
  3. #3
    Hi,

    I have wrapped the code inside the Code Tags..
  4. #4
    Hi,

    That bug was fixed already. Fix in the SVN

Similar Threads

  1. RadioGroup.CheckedItems.Count == 0 v1.2.0
    By chearner in forum 1.x Help
    Replies: 4
    Last Post: Dec 09, 2011, 2:23 PM
  2. How to Get the RadioGroup.CheckedItems?
    By sk2276699 in forum 1.x Help
    Replies: 1
    Last Post: Jun 28, 2011, 3:22 AM
  3. Replies: 9
    Last Post: Jun 15, 2011, 7:01 AM
  4. Replies: 16
    Last Post: May 19, 2010, 10:58 AM
  5. [CLOSED] [1.0] RadioGroup CheckedItems empty
    By danielg in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 28, 2010, 5:12 PM

Posting Permissions