Loadondemand and problem in obtaining selected value

3 posts, 0 answers
  1. Canis Lupus
    Canis Lupus avatar
    9 posts
    Member since:
    Aug 2012

    Posted 28 Dec 2010 Link to this post


    I am using loadondemand for a radcombobox control as follow:

    <telerik:RadComboBox ID="DDL_district" Runat="server"
    DataSourceID="DS_district" DataTextField="fullAddress  
    ="recID" Width="100%" AppendDataBoundItems="True"
                                EnableAutomaticLoadOnDemand="True" Filter="Contains"
                                MinFilterLength="3" ShowMoreResultsBox="True"
                                EnableVirtualScrolling="True" ItemsPerRequest="10"
                                EmptyMessage="No such district in the database."
                                    <telerik:RadComboBoxItem runat="server" Selected="True"
                                        Text="some text"
                                        Value="0" />

    when I try to obtain the selected value in run-time I always get "0" value even if I select an item from database.
    I use following code to get districtID value

    Dim districtID As String = DDL_district.SelectedValue

    Am I missing something?
  2. msigman
    msigman avatar
    141 posts
    Member since:
    Apr 2008

    Posted 28 Dec 2010 Link to this post

    You've put for the value:

    Try to set the value to a meaningful number, or string.  Or you could use the SelectedItem property instead.
  3. DevCraft R3 2016 release webinar banner
  4. Dimitar Terziev
    Dimitar Terziev avatar
    1266 posts

    Posted 03 Jan 2011 Link to this post

    Hi Mehmet,

    Sorry for my late response.

    In order to get the selected items value in server-side first you should perform a postback.
    I've prepared a small example for you showing how to get the value of the selected item from the combobox.
    Also you could check this article here for more information.
    I hope this will help.

    Best wishes,
    Dimitar Terziev
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Back to Top