I can't really point you in any direction without seeing more of the code, but I can say that I have had similar problems several times. Values disappearing upon re-saving a page, copying a page etc. And it has always turned out to be some kind of error in my logic. So keep looking, debug and step through the code and sooner or later you'll fingure it out!
Hi Magnus, thank you for your reply - always helpful as usual.
I figured it out. As I had three dropdowns on the page, I decided to not make use of the base.Editcontrol dropdownlist. When saving the page i.e.) ApplyEditChanges(), I was still calling base.ApplyEditChanges(), which using Reflector, I realised was doing the following:
...and as base.EditControl was not being used, its selecetValue property was null. So my value was being over-written by null.
So once I removed base.ApplyEditChanges(), my code worked fine and the values were no longer removed.
Thank you once again!
Hi Mohammed Laies,
Can you share your code with me
as there is a lot of code, it would probably be best if you email me at firstname.lastname@example.org and I will send you the code.
Hi all, I have a compund custom property with 3 dropdowns. The selection of each dropdown populates sub-dropdowns..etc. The property type is of type PropertyLongString.
When 'AppyEditChanges()' is called, I call 'SetValue()' and I store the value as: droipdownvalue1~dropdownvalue2~dropdownvalue3, and this works fine in storing the value.
When the control is loaded in edit mode and 'CreateEditControls()' is called, I do the following:
if (this.PropertyData.Value != null)
string selections = this.PropertyData.Value.ToString().Split('~');
I then take the split values and set the appropriate selected values for each dropdownlist. This all works fine.
The problem is that the value in 'this.PropertyData' seems to be cleared randomly. So when the page loads, the appropriate dropdowns dont get set their previously saved value. This seems to be intermittent. Sometimes it works and other times not.
Any help would be much appreciated.