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

Only first item gets selected always if text of the items are duplicates

2 Answers 67 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Raghavendra
Top achievements
Rank 1
Raghavendra asked on 28 Dec 2011, 01:51 PM
Hi,

Let us say our list is as follows:

1. Raghu
2. Ram
3. Gandhi
4. Raghu

Though the user selects the 4th Raghu, the selected item that is being sent to the server is the 1st Raghu!

I remember this being mentioned as a known issue somewhere in the forum. However, in my case, there is no way to actually ensure that the text of the item is going to be unique because the list being shown actually is a list of persons. This is really a deal breaker for me!

Any ideas on how to fix this?

Thanks,
Raghu

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 28 Dec 2011, 02:17 PM
Hello Raghavendra,

If you are having Radcombobx Items with same text without unique values, this behavior is expected. So please make sure that the Items having different values even if the Text are similar.

aspx:
<telerik:RadComboBox ID="RadComboBox1" runat="server"  onselectedindexchanged="RadComboBox1_SelectedIndexChanged" AutoPostBack="true" >
 <Items>
  <telerik:RadComboBoxItem Text="Text1" Value="1" />
  <telerik:RadComboBoxItem Text="Text2" Value="2" />
  <telerik:RadComboBoxItem Text="Text3" Value="3" />
  <telerik:RadComboBoxItem Text="Text1" Value="4" />
 </Items>
  </telerik:RadComboBox>

Hope it helps.

Thanks,
Shinu.
0
Raghavendra
Top achievements
Rank 1
answered on 29 Dec 2011, 12:57 PM
Hmmm... Problem with the query was returning same ID value for all the rows. Hence the wrong selection! Fixed now.

Thanks,
Raghu
Tags
ComboBox
Asked by
Raghavendra
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Raghavendra
Top achievements
Rank 1
Share this question
or