This is a migrated thread and some comments may be shown as answers.

Find Value of Combobox in RadPanel

2 Answers 69 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Aaron
Top achievements
Rank 1
Aaron asked on 27 Aug 2012, 06:05 PM
I am trying to do a redirect in codebehind based on the value a user has selected in a combobox.  Can someone please tell me how to access the value? Using VB.NET please!

Thanks!    

**UPDATE: How do I access the button as well?  Can someone give me a codebehind example please in VB.NET  

<telerik:RadPanelBar ID="RadPanelBar2" Runat="server" Width="100%" ExpandMode="SingleExpandedItem">
                    <Items>
                        <telerik:RadPanelItem runat="server" Text="PURCHASE ACCOUNT CREDITS">
                            <Items>
                                <telerik:RadPanelItem Value="AccountCredits" runat="server">
                                    <ItemTemplate>
                                        <table width="100%" border="0" cellspacing="2" cellpadding="2">
                                            <tr align="center">
                                                <td>How many credits would you like to purchase?</td>
                                            </tr>
                                            <tr align="center">
                                                <td>
                                                    <telerik:RadComboBox ID="cbxCredits" runat="server">
                                                        <Items>
                                                            <telerik:RadComboBoxItem runat="server" Text="$1.00 - 4 Credits" Value="1.00" />
                                                            <telerik:RadComboBoxItem runat="server" Text="$5.00 - 25 Credits" Value="5.00" />
                                                            <telerik:RadComboBoxItem runat="server" Text="$10.00 - 50 Credits" Value="10.00" />
                                                        </Items>
                                                    </telerik:RadComboBox>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td align="center">
                                                    <telerik:RadButton ID="btnCheckout" runat="server" Text="CONTINUE TO CHECKOUT..."></telerik:RadButton>
                                                </td>
                                            </tr>
                                        </table>
                                    </ItemTemplate>
                                </telerik:RadPanelItem>
                            </Items>
                        </telerik:RadPanelItem>

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 28 Aug 2012, 05:30 AM
Hi Aaron,

You can access the controls as follows.

VB:
Dim rcb As RadComboBox = DirectCast(RadPanelBar2.FindItemByValue("AccountCredits").FindControl("cbxCredits"), RadComboBox)
Dim value As String = rcb.SelectedValue
Dim btn As RadButton = DirectCast(RadPanelBar2.FindItemByValue("AccountCredits").FindControl("btnCheckout"), RadButton)

Thanks,
Shinu.
0
Dennis
Top achievements
Rank 2
answered on 07 Feb 2018, 11:14 PM
How would you do that in javascript?
Tags
PanelBar
Asked by
Aaron
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Dennis
Top achievements
Rank 2
Share this question
or