RadComboBox.SelectedItem is null

2 posts, 0 answers
  1. TravelMan
    TravelMan avatar
    4 posts
    Member since:
    Feb 2009

    Posted 14 Apr 2011 Link to this post

    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();
  2. Helen
    Admin
    Helen avatar
    1052 posts

    Posted 19 Apr 2011 Link to this post

    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.

Back to Top