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

SelectedIndex -1 is ignored

1 Answer 75 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Deepak Vasudevan
Top achievements
Rank 2
Deepak Vasudevan asked on 15 Nov 2011, 03:59 PM
I am trying to set SelectedIndex -1 with the objective that I don't any item in the RadCombo to be highlighted. Whilst the debugger passes the line the next statement says SelectedIndex 0.

How to make the RadCombo not to select any particular item automatically?

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 16 Nov 2011, 10:54 AM
Hello,

To avoid automatic selection of RadComboBox you can try any of the following approaches.

1) Set EmptyMessage property.

2) Add an empty text as first RadComboBoxItem. Here is the sample ASPX.

ASPX:
<telerik:RadComboBox ID="RadComboBox1" runat="server"
            AutoPostBack="true"  Skin="Sunset" EnableAjaxSkinRendering="false"  >
      <Items>
            <telerik:RadComboBoxItem Text="" Value="-1" />
            <telerik:RadComboBoxItem Text="WNEN" Value="WNEN"  >
            </telerik:RadComboBoxItem>
            <telerik:RadComboBoxItem Text="WNES" Value="WNES">
            </telerik:RadComboBoxItem>
            <telerik:RadComboBoxItem Text="GBRN" Value="GBRN">
            </telerik:RadComboBoxItem>
            <telerik:RadComboBoxItem Text="GBRS" Value="GBRS">
            </telerik:RadComboBoxItem>
     </Items>      
</telerik:RadComboBox>

Thanks,
Princy.
Tags
ComboBox
Asked by
Deepak Vasudevan
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
Share this question
or