Use non-deafult setting for DropDownList?

Vote:
 

I have several settings defined for DropDownList (Admin/Config/Edit custom property types/Drop-down list).

I also have a couple of properties that are supposed to get their values from these different settings, but I am only able to get the values from the setting that is set as default.

        [Editable(true)]
        [UIHint("DropDownList")]
        [Display(
            Name = "Zoom",
            Description = "",
            GroupName = "Maps",
            Order = 310)]
        public virtual string BigZoom { get; set; }

Is there a way to specify which setting a DropDownList property should use?

#75675
Oct 03, 2013 14:41
Vote:
 

Administrative view->Page/Block type->Select your type->Select the property->Custom Settings tab->Select "Use custom settings" and then create your settings.

#75689
Oct 03, 2013 17:25
Vote:
 

You can also select a global setting other than the one marked as default in the last step instead of creating a custom setting. This is a good option if you want to reuse these settings among different settings.

#75690
Oct 03, 2013 17:27
Vote:
 

Thanks for a quick answer. But, there I find "This class does not have any custom settings." Am I using the wrong propertytype? I'm using "string" with [UIHint("DropDownList")] in my typed page definition as seen in the code above.

#75703
Oct 04, 2013 8:02
Vote:
 

What kind of PropertyType does your admin mode say your Property is?

#75709
Oct 04, 2013 9:16
Vote:
 

Long String (>255)

#75710
Oct 04, 2013 9:18
Vote:
 

Since UIHint does not affect the property being used and property settings are connected to the actual property type you need to redefine the backing type to be able to get access to property settings. This can be done by the following code:

[BackingType(typeof(PropertyDropDownList))]
public virtual string DynamicList { get; set; }

#75716
Oct 04, 2013 9:38
Vote:
 

Linus, Is the idea that when we want to create custom PropertySettings we use the old Custom Properties and the PropertySettingsAttribute on a PropertyControl or are there any new way to add PropertySettings to a Property / EditorDescriptor?

#75718
Oct 04, 2013 10:13
Vote:
 

Well, actually we wanted to add support to be able to define property settings directly on the property using an attribute. But we have to drop/postpone this due to time constraints.

 

Property settings are still defined on the backing property type(classes deriving from PropertyData) which is a bit unfortunate since we want to move away from partners using this layer directly. So for now, you still need to create a class deriving from PropertyData if you want to use property settings and use the BackingType attribute if your value type is the same as one of the built in properties (string, int, XhtmlString etc.). This will not change with the 7.5 release but I hope that we can simplify this for the future.

#75721
Oct 04, 2013 10:30
Vote:
 

Thank you for your help!

#75723
Oct 04, 2013 10:34
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.