RadComboBox return wrong selected value if 2 or more item has same text

4 posts, 0 answers
  1. guillaume.lebel
    guillaume.lebel avatar
    60 posts
    Member since:
    Oct 2012

    Posted 19 May 2011 Link to this post


    I have a radcombobox who have some item with the same text(ex: Item1, Item1), but both has a different value. But when i want to get the selectedValue of the second one, it always return me the first item value.

    Is the a way to return the good value even if there two or more item that has the same text.

    Thx for your help,

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 20 May 2011 Link to this post

    Hello Guillaume,

    I have tried the same and that worked as expected at my end. Here am pasting my code.
    <telerik:RadComboBox ID="RadComboBox1" runat="server"
    onselectedindexchanged="RadComboBox1_SelectedIndexChanged" AutoPostBack="true">
      <telerik:RadComboBoxItem Text="12345"  Value="1"/>
      <telerik:RadComboBoxItem Text="12345" Value="2" />
      <telerik:RadComboBoxItem Text="12345" Value="3" />
      <telerik:RadComboBoxItem Text="12345"  Value="4"/>
      <telerik:RadComboBoxItem Text="12345" Value="5" />
      <telerik:RadComboBoxItem Text="12345" Value="6" />
    protected void RadComboBox1_SelectedIndexChanged(object sender, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)

  3. DevCraft R3 2016 release webinar banner
  4. Tony
    Tony avatar
    1 posts
    Member since:
    Sep 2013

    Posted 24 Oct 2014 in reply to Shinu Link to this post

    I am having the same issue. If I change the DataTextValue of one of the items such that the DataTextValues are now unique, it will select the correct one. I am setting the datasource in code and calling the databind method instead of manually defining them like the example above.
  5. Nencho
    Nencho avatar
    1446 posts

    Posted 29 Oct 2014 Link to this post

    Hello Tony,

    I am not quite sure that I had understood how exactly you have your RadComboBox implemented at your end. Could you specify what DataText and DataValue fields have you set and which are the unique fields. Generally, in order to have the selection correctly behaving, you need to ensure that the Values of the RadComboBoxItems are unique. Please provide us with the implementation that you use at your end, so we could inspect it.


    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