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

RadComboBox SelectedItem and SelectedProperty Issue

1 Answer 80 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ashish
Top achievements
Rank 1
Ashish asked on 07 Sep 2012, 02:57 PM

Hello Telerik Team,

I have used RadCombox in my site extensively, and also I have used the “EmptyMessage” property. Recently I have updated the Telerik version to “2012.2.724.35” and after that i am facing too many issues related to RadCombox.

Older Version we were using: 2011.1.519.35
New Version currently we are using: 2012.2.724.35

In Telerik “2012.2.724.35” version, i have used the following RadComboBox In my web page. Now the issue is, if I do not change the default selection of following ddlStatus i.e. the ddlStatus is set to “-Select One-” and when I trying to access the “SelectedItem” property of ddlStatus from code behind, then it gives a null value whereas with the previous telerik version (2011.1.519.35), if the ddlStatus is set to default selection i.e. “-Select One-” and if I trying to access the “SelectedItem” property of ddlStatus then it gives the object of 0th position item i.e. <telerik:RadComboBoxItem Text="" Value="0" />. Besides that, in “2012.2.724.35” version, for the default selection of ddlStatus, the ddlStatus.SelectedValue property gives the Empty string where as in older version(2011.1.519.35) it gives the value of 0th element i.e. "0".   

<telerik:RadComboBox ID="ddlStatus" runat="server" Width="60px" EmptyMessage="-Select one-">

       <Items>

              <telerik:RadComboBoxItem Text="" Value="0" />

              <telerik:RadComboBoxItem Text="No" Value="1" />

              <telerik:RadComboBoxItem Text="Yes" Value="2" />

       </Items>

</telerik:RadComboBox>

 

This changed behavior of RadComboBox encounters so many issues in my website. Is there any generic way to resolve this issue?

Please suggest the workaround to resolve this issue.

Thanks,
Ashish

 

1 Answer, 1 is accepted

Sort by
0
Cat Cheshire
Top achievements
Rank 1
answered on 12 Sep 2012, 09:57 AM
You can try setting the first RadComboBoxItem Text to space(" ") instead of empty string.
Tags
General Discussions
Asked by
Ashish
Top achievements
Rank 1
Answers by
Cat Cheshire
Top achievements
Rank 1
Share this question
or