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

Clicking dropdown button triggers selectedindexchanged event

5 Answers 292 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Jeremy
Top achievements
Rank 1
Jeremy asked on 05 Aug 2008, 05:25 AM
I'm using Q2 2008. When I click the combobox dropdown button, and don't actually change the selected value, the SelectedIndexChanged event fires even though nothing has changed. The result is the SelectedItem is then Nothing and my code causes an error. The .Text property does contain the selected items text, but everything else pertaining to the selected item, indicates that nothing is selected.

5 Answers, 1 is accepted

Sort by
0
Rosi
Telerik team
answered on 05 Aug 2008, 06:58 AM
Hello Jeremy ,

This event will fire only when the text is changed. This is the expected behavior. In this case if the Text does not match with any of the items the SelectedItem will be Nothing.

If this is not the case could you please paste the definition of your RadComboBox here to reproduce the problem locally?

Regards,
Rosi
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Jeremy
Top achievements
Rank 1
answered on 05 Aug 2008, 01:54 PM
Here is my declaration.

        <telerik:RadComboBox ID="RadComboBox1" runat="server" 
            CausesValidation="false" 
            MarkFirstMatch="true"   
            Skin="Office2007"   
            AutoPostBack="true"   
            Width="456" 
            CollapseAnimation-Type="None" 
            
ExpandAnimation-Type="None" 
            Height="150px"   
            NoWrap="true"   
            AppendDataBoundItems="true"   
            EnableEmbeddedSkins="true">  
        </telerik:RadComboBox> 
0
Jeremy
Top achievements
Rank 1
answered on 05 Aug 2008, 04:44 PM
I have uncovered some more detail to narrow this down. This is only happening on a specific item in the list. The text of the item is:

Related Certificate of Completion (46 -89 credits)

The space after the number 46 is a typo. What happens is that when the text is displayed as the selected item, it somehow removes the space. If you click the dropdown button, and then cause it to lose focus, the space appears after the 46. This then causes the SelectedIndexChanged event to fire on a postback.

I swapped the combobox out for an asp dropdownlist, and it behaves normally. The space typo is there regardless. Obviously, an easy fix is to correct the typo, but the behavior I explained appears to be a bug.

0
Rosi
Telerik team
answered on 06 Aug 2008, 11:48 AM
Hi Jeremy,

We tried to reproduce the problem but to no avail. Please find the attached my test project. Am I missing something?

Regards,
Rosi
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Jeremy
Top achievements
Rank 1
answered on 06 Aug 2008, 07:25 PM
I tried many different scenarios to isolate this issue. I added the space back in after removing it, and the issue is no longer there. Might have been bad data.

Thanks.
Tags
ComboBox
Asked by
Jeremy
Top achievements
Rank 1
Answers by
Rosi
Telerik team
Jeremy
Top achievements
Rank 1
Share this question
or