Mar 31, 2009, 1:44 PM
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:
Regards,
Tadeusz
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&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