SaaS CMS has officially launched! Learn more now.

Is it possible to get the underlying data of dropdown-list type

Vote:
 

Hi I am having this problem and stucked this for few days. My problem is I am having a property use dropdown-list type, I want to display all the values stored in this type on the page. By using PageData.Property["xx"] I can only get the single value, not all of them. 

Thanks

#56940
Feb 17, 2012 4:27
Vote:
 

Hi Vincent!


Selections in the drop down list property are stored in property settings. Use EPiServer.Web.PropertyControls.PropertySettings.MultipleOptionsListSettings to access them.
For example like this:

var setting = (MultipleOptionsListSettings)CurrentPage.Property["MyProp"].GetSetting(typeof(MultipleOptionsListSettings));

Then you can access the list options:

setting.ListOptions

/Klas    

#56944
Feb 17, 2012 10:59
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.