how to select the item in radcombobox based on item value ?

4 posts, 0 answers
  1. Hemanth
    Hemanth avatar
    1 posts
    Member since:
    Jan 2013

    Posted 02 Jan 2013 Link to this post


    I am using radcombobox in my project, bind the combo box using page methods see this link.(last method) Working fine to display the items based on loadondemond, but after save the data when i am trying to edit  i am assigning to radcombobox based on item value , but it is not working properly, because radcombobox items are not loaded .

     my code is
    i am trying bellow two ways

    1) RadComboBox4.SelectedValue = dr["AgentID"].ToString();

    2) RadComboBox4.FindItemByValue(dr["AgentID"].ToString()).Selected = true;

    the second method  showing the error , selecteditem and selectedindex always shows null and -1. 

    please can any one help me to come out this problem .

  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 03 Jan 2013 Link to this post

    Hi Hemanth,

    By design when a RadComboBox with enabled Load-On-Demand feature is loaded - it is empty and it has no items. Load-On-Demand fires and populates the control with data if the user types in the input area or clicks on the drop-down toggle image when there are no items in the RadComboBox.

    Additionally the RadComboBox items are not accessible on the server-side when loading them on demand and that is why they cannot be accessed using the server-side FindItemByText / Value methods - please take a look at this help article.

    Hope this helps.

  3. DevCraft R3 2016 release webinar banner
  4. Rajesh
    Rajesh avatar
    3 posts
    Member since:
    May 2014

    Posted 17 Oct 2014 Link to this post

    Hi Telerik,

    I too have the same problem, I have a search page where all the records will be listed and on clicking a record, the details page gets loaded with the selected record data and there is a city dropdown with load on demand feature and I am adding an item to the RadComboBox with the below code. And I'm able to set the selected record city. But the problem is when I click on the Combo I see the City added for the selected record twice. And I understood that it is by design. Is there a way to clear the item. Please help me in this regard.
    var city = new RadComboBoxItem
         Text = Convert.ToString(city),
         Value = Convert.ToString(cityId)
    rcbCity.SelectedValue = Convert.ToString(cityId); 

  5. Plamen
    Plamen avatar
    2723 posts

    Posted 21 Oct 2014 Link to this post


    You can refer to this help topic where one way to clear the selection of RadComboBox is provided.

    Hope this will help you solve the issue. 


    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top