Don't miss out Virtual Happy Hour this Friday (April 26).
Try our conversational search powered by Generative AI!
AI OnAI Off
Don't miss out Virtual Happy Hour this Friday (April 26).
When you check the value for a PropertyBoolean its either null or true:
if(myPropertyBoolean.IsNull)
// its false
else
// its true
So try to set it to null instead of false. Just an idea that came to mind. Havent tested it.
/Hans
Hi
I got into almost the same problem myself regarding setting the value for a selected/not selected property. It seems that it's not possible to set the value in a dynamic property of type selected/not selected to the value "not selected".
Read this thread for explanation:
http://world.episerver.com/Forum/Pages/Thread.aspx?id=13118&epslanguage=en
Hello,
I'm trying to change a radio button property from a Edit plugin in the parent of some children pages. I am cloning each of the pages to make them writable. The problem is that I don't seem to be able to change the value of the Selected/not Selected property. However, I am able to change other properties that are text for example. I wonder if there is a special extra step that needs to be done for these type of properties (selected/not selected)?
Here's the code:
protected void SelectHeroImage_CheckedChanged(object sender, EventArgs e)
{
string pageID = ((CBSOutdoor.Classes.RepeatableRadioButton)(sender)).SelectedPageId;
foreach (PageData pd in ((PageDataCollection)imageList.DataSource))
{
//Get a writable PageData object to modify
//PageData myWritablePage = EPiServer.DataFactory.Instance.GetPage(pd.PageLink);
PageData myWritablePage = pd.CreateWritableClone();
if (pd.PageLink.ID == Convert.ToInt32(pageID))
{
myWritablePage.Property["HeroImage"].Value = true;
//myWritablePage.Property["Keywords"].Value = "Value is True";
}
else
{
myWritablePage.Property["HeroImage"].Value = false;
//myWritablePage.Property["Keywords"].Value = "Value is False";
}
//Perform 'Save and publish' programmatically
DataFactory.Instance.Save(myWritablePage, SaveAction.Publish);
}
LoadPages();
}
Thanks.
Victor