RadComboBoxes lose values after postback

2 posts, 0 answers
  1. Matt
    Matt avatar
    87 posts
    Member since:
    Mar 2009

    Posted 13 Apr 2016 Link to this post

    We have an update panel on the page that contains rows of controls.  The user can add additional rows or remove existing ones using a button that performs an Ajax postback.  If the user adds additional rows, the values of the RadComboBox remain and life is good.  However, if the user removes a row, the combobox value is lost (the items are there, but the selected index is set to -1).

    In stepping through the code, I can see that the values are indeed set after Page_Load and Page_PreRender, but when the page is finally displayed, the values have been removed.

    I've searched high and low and it appears this is an issue others have experienced as well (http://www.telerik.com/forums/selectedvalue-lost-on-postback-in-dynamically-added-user-controls).  Unfortunately, I can't bind the values in Page_Init (as suggested in the post) as I need information from ViewState that isn't available until Page_Load.

    All other controls on the update panel retain their value; it's *only* the comboboxes that lose theirs.

    Has anyone else experienced this lately and, if so, what was the workaround?

    We're using Telerik 2014 Q2 in VS2015 (C#).

  2. Nencho
    Nencho avatar
    1661 posts

    Posted 18 Apr 2016 Link to this post

    Hello Matt,

    Indeed, in order to persist the viewstate of the controls from a UserContorl - it should be added at Page_Init. However, you mentioned that the problem only persists with the RadComboBox control. This is why, I would like to ask you to submit a support ticket, along with a runnable sample attached, so we could locally test the behavior and eventually suggest you a workaround.

    On a side note, could you please test the behavior by replacing the RadComboBox with a RadDropDownList, which is almost similar control, but a bit simplified.

    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top