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

RadComboBoxes lose values after postback

1 Answer 232 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Matt
Top achievements
Rank 1
Matt asked on 13 Apr 2016, 01:04 PM

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#).

1 Answer, 1 is accepted

Sort by
0
Nencho
Telerik team
answered on 18 Apr 2016, 07:28 AM
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.

Regards,
Nencho
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
ComboBox
Asked by
Matt
Top achievements
Rank 1
Answers by
Nencho
Telerik team
Share this question
or