Find Value of Combobox in RadPanel

2 posts, 0 answers
  1. Aaron
    Aaron avatar
    5 posts
    Member since:
    Dec 2011

    Posted 27 Aug 2012 Link to this post

    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. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 28 Aug 2012 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top