Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I can't seem to manipulate the items displayed in a DropDownChoiceField I have that's tied to a field on the custom content type with big, really frustrating problems.

This field is only visible in edit mode.

When I use C# to add/remove items it displays fine, i.e. - it removes/adds the items I have specified. (Bearing in mind this field is automatically populated as it's tied to the choices I've specified in the content type's xml). It even allows me to save and close the page. But then, from design mode, when I go into edit mode I'm getting the following error:

Failed to load viewstate. The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request. For example, when adding controls dynamically, the controls added during a post-back must match the type and position of the controls added during the initial request.

I got around this by changing the ascx to enableviewstate=false, but now it doesn't save to the field!?

Really frustrating. If anyone can suggest a way I can create my own dropdownlist and populate the relevant page's property in code behind then I'll happily opt for this as an alternative. I just don't know where to go from here.

share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.