[CLOSED] RadioGroup Events

  1. #1

    [CLOSED] RadioGroup Events

    I've got RadioGroup with three radio buttons. I would call an event when he chooses a Radio or change
    Last edited by Daniil; Mar 29, 2012 at 10:44 PM. Reason: [CLOSED]
  2. #2
  3. #3
    but I want to call an event in codebehind
  4. #4
    Please use the Change DirectEvent or call a DirectMethod within a Change listener.
  5. #5
    well I tried but did not call the event
                                <ext:RadioGroup ID="rdbExecutar" runat="server" FieldLabel="ssfsdf" LabelWidth="160"
                                    LabelAlign="Right" ColumnsNumber="2">
                                    <Items>
                                        <ext:Radio ID="rdbExecutarAgora" runat="server" BoxLabel="tttt">
                                        </ext:Radio>
                                        <ext:Radio ID="rdbExecutarDataHora" runat="server" Checked="true" BoxLabel="xxxx">
                                        </ext:Radio>
                                    </Items>
                                    <DirectEvents>
                                        <Change OnEvent="OnOne"  />
                                    </DirectEvents>
                                </ext:RadioGroup>
    ....
    CodeBehind
    
            protected void OnOne(object sender, DirectEventArgs e)
            {
                string x = "xxx";
            }
  6. #6
    The RadioGroup Change DirectEvent triggers correctly in the example below.

    Example
    <%@ Page Language="C#" %>
     
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void RadioGroup_Change(object sender, DirectEventArgs e)
        {
            RadioGroup rg = sender as RadioGroup;
            X.Msg.Alert("Change", rg.CheckedItems[0].ID).Show();
        }
    </script>
    
    <!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>Ext.NET Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:RadioGroup runat="server" ColumnsNumber="1">
                <Items>
                    <ext:Radio ID="Radio1" runat="server" Checked="true" />
                    <ext:Radio ID="Radio2" runat="server" />
                </Items>
                <DirectEvents>
                    <Change OnEvent="RadioGroup_Change" />
                </DirectEvents>
            </ext:RadioGroup>
        </form>
    </body>
    </html>
  7. #7

    Index was out of range. Must be non-negative and less than the size of the collection.

    
     <ext:RadioGroup ID="RadioGroupBody" runat="server" FieldLabel="Body" LabelWidth="150"
                                            Width="400" ColumnsNumber="3">
                                            <DirectEvents>
                                                <Change OnEvent="RadioGroup_Change" />
                                            </DirectEvents>
                                        </ext:RadioGroup>
    code behind..

    RadioGroupBody.Items.Add(new Radio
                {
                    ID = "Text",
                    IDMode = IDMode.Explicit,
                    BoxLabel = "Text",
                    InputValue = "Text",
                    Checked = ResouceContentFormat == "Text" ? true : false
                });
    
                RadioGroupBody.Items.Add(new Radio
                {
                    ID = "Url",
                    IDMode = IDMode.Explicit,
                    BoxLabel = "URL",
                    InputValue = "Url",
                    Checked = ResouceContentFormat == "Url" ? true : false
                });
    
                RadioGroupBody.Items.Add(new Radio
                {
                    ID = "File",
                    IDMode = IDMode.Explicit,
                    BoxLabel = "Upload",
                    InputValue = "File",
                    Checked = ResouceContentFormat == "File" ? true : false
                });
    
                RadioGroupBody.AddTo(formpanel1);

    
     protected void RadioGroup_Change(object sender, DirectEventArgs e)
        {
            RadioGroup rg = sender as RadioGroup;
            X.Msg.Alert("Change", rg.CheckedItems[0].ID).Show();
        }
  8. #8
    Please start a new forum thread. If you feel the threads are related, please feel free to cross-link between the two.

Similar Threads

  1. Replies: 15
    Last Post: Feb 03, 2011, 1:27 PM
  2. Replies: 4
    Last Post: Jul 17, 2010, 8:21 AM
  3. [CLOSED] [1.0] RadioGroup
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Mar 08, 2010, 7:54 AM
  4. [CLOSED] RadioGroup events
    By tdracz in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Oct 08, 2009, 7:20 AM
  5. [CLOSED] RadioGroup needs help
    By jsemple in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Mar 12, 2009, 11:51 AM

Posting Permissions