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

RadComboBox.SelectedItem is null

1 Answer 238 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
TravelMan
Top achievements
Rank 1
TravelMan asked on 14 Apr 2011, 10:13 PM
We populated radComboBox in page_load method once it not from post back. When the user click a button and we will read selected item using following code

cmbCustAcctNo.SelectedItem.Text

However, we got object null reference because SelectedItem is null. We have verified EnableLoadOnDemand = false and AllowCustomText = false. Do we miss anything? 

version: 2008.2.826.35

<telerik:RadComboBox ID="cmbCustAcctNo" Width="128px"
    runat="server" Skin="Office2007" CausesValidation="false" AutoPostBack="true"
    ToolTip="Select Account Number"
    onselectedindexchanged="cmbCustAcctNo_SelectedIndexChanged">
</telerik:RadComboBox>

IList<prcWebAccountsForUserResult> listOfAcctNo = accountNumbers.ToList();
cmbCustAcctNo.DataSource = listOfAcctNo;
cmbCustAcctNo.DataTextField = "AccountNumber";
cmbCustAcctNo.DataValueField = "AccountNumber";
cmbCustAcctNo.DataBind();

1 Answer, 1 is accepted

Sort by
0
Helen
Telerik team
answered on 19 Apr 2011, 06:33 PM
Hello,

We tested the behavior locally, but couldn't reproduce the issue. Please find attached our test files.
Do the attached page work at your side?
If yes - could you please modify it so we can see the problem locally?

Greetings,
Helen
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
ComboBox
Asked by
TravelMan
Top achievements
Rank 1
Answers by
Helen
Telerik team
Share this question
or