Creating a checkbox propertytype

Vote:
 
I am trying to create a new property type that should be rendered as checkboxes in editmode. The type is derived from PropertyString. The property renders itself as it should but the values won't get stored in EPiServer. What kind of controls should I use and do I have to add more things like ParseToObject()? Here is some code from CreateChildControls(): CheckBoxList cbList = new CheckBoxList(); CopyWebAttributes(container, cbList); cbList.RepeatColumns = 3; cbList.RepeatLayout = RepeatLayout.Table; cbList.Items.Add(new ListItem("Value A", "a")); cbList.Items.Add(new ListItem("Value B", "b")); cbList.Items.Add(new ListItem("Value C", "c")); container.Controls.Add(cbList); container.Controls.Add(CreateParseValidator(cbList)); - Johan
#12191
Mar 25, 2008 18:34
Vote:
 
The source code for PropertyWeekday is available in the SDK under source\EPiServer\SpecializedProperties, it does the exact same operation. The trick is that you have to add your own ParseValidation handler to read back settings from your control.
#13819
Mar 25, 2008 18:43
* 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.