Getting selected RadioGroup value through inputValue

  1. #1

    Getting selected RadioGroup value through inputValue

    Hello,

    I was wondering if a scenario similar to this one is possible.

    I have the definition of the RadioGroup similar to this one:

                 <ext:RadioGroup ID="typeRadioGroup" runat="server" ColumnsNumber="1">
                    <Items>
                        <ext:Radio ID="onceRadio" runat="server" BoxLabel="One&amp;nbsp;time" Checked="true">
                        </ext:Radio>
                        <ext:Radio ID="dailyRadio" runat="server" BoxLabel="Daily">
                            <CustomConfig>
                                <ext:ConfigItem Name="inputValue" Value="1" Mode="Raw" />
                            </CustomConfig>
                        </ext:Radio>
                        <ext:Radio ID="weeklyRadio" runat="server" BoxLabel="Weekly">
                            <CustomConfig>
                                <ext:ConfigItem Name="inputValue" Value="2" Mode="Raw" />
                            </CustomConfig>
                        </ext:Radio>
                        <ext:Radio ID="monthlyRadio" runat="server" BoxLabel="Monthly">
                            <CustomConfig>
                                <ext:ConfigItem Name="inputValue" Value="3" Mode="Raw" />
                            </CustomConfig>
                        </ext:Radio>
                    </Items>
                </ext:RadioGroup>
    On the server side I would like to be able to do something similar to this:

    var value = typeRadioGroup.CheckedItems[0].InputValue;
    to get the selected value directly and proceed with the code instead of calling e.g.

    if (dailyRadio.Checked)
    // do something
    else if (weeklyRadioChecked)
    // something else
    It would create more cleaner design and would allow me to generate the radios dynamically (on the server side). When I generate radios dynamically, I don't really see a different way than to recognize the selected radio by ID. Or is there a different way?

    Regards,
    Tadeusz



  2. #2

    RE: Getting selected RadioGroup value through inputValue

    Hi,

    What about

    var value = typeRadioGroup.CheckedItems[0].CustomConfig[0].Value; I understand that it is not so useful. We will investigate how to improve it

  3. #3

    RE: Getting selected RadioGroup value through inputValue

    Hi,

    It would work in cases when dynamic radios are generated on server, however in other cases when I for example use there a JavaScript enumeration, this is not resolved and I get the full enumeration name instead of the value, e.g.:

    <CustomConfig>
     <ext:ConfigItem Name="temp" Value="Enums.ScheduleType.Daily" Mode="Raw" />        
    </CustomConfig>
    and Enums.ScheduleType.Daily is 0, in AjaxEvent I receive 'Enums.ScheduleType.Daily' for typeRadioGroup.CheckedItems[0].CustomConfig[0].Value. In this case this enumeration we keep automatically synchronized with the corresponding server enumeration.

    Thanks,
    Tadeusz

Similar Threads

  1. how get selected index value of radiogroup
    By abhi_sheklohiya in forum 1.x Help
    Replies: 3
    Last Post: Mar 29, 2012, 10:12 PM
  2. RadioGroup With InputValue cann't checked
    By nanlinfeixue in forum 1.x Help
    Replies: 5
    Last Post: Jul 01, 2011, 6:38 AM
  3. RadioGroup bug getting the selected item
    By paul-2011 in forum 1.x Help
    Replies: 1
    Last Post: Apr 06, 2011, 2:21 PM
  4. [CLOSED] [1.0] RadioGroup with InputValue set to "0"
    By danielg in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Nov 15, 2010, 1:56 PM
  5. Replies: 0
    Last Post: Jun 08, 2009, 12:04 PM

Posting Permissions