This article describes how to modify the layout of the multiple choice form control.
If you want to change it in e.g.
MyProfile webpart you can modify the file
~/CMSModules/Membership/Controls/MyProfile.ascx.cs. Replace the existing
OnPreRender method with the following:
protected override void OnPreRender(EventArgs e)
{
base.OnPreRender(e);
editProfileForm.BasicForm.SubmitButton.CssClass = "ContentButton";
foreach (object c in editProfileForm.BasicForm.FindControl("pnlForm").Controls)
{
if (c is CMS.FormControls.EditingFormControl)
{
CMS.FormControls.EditingFormControl efc = (CMS.FormControls.EditingFormControl)c;
if (efc.NestedControl is CheckBoxList)
{
CheckBoxList cbl = (CheckBoxList)efc.NestedControl;
cbl.RepeatLayout = RepeatLayout.Flow;
// This removes the "random" BR thats placed after each checkbox
cbl.RepeatDirection = RepeatDirection.Horizontal;
}
}
}
}
Now any multiple choice fields that you add will be rendered next to each other without using the HTML table.
See also:
Applies to:
Kentico CMS 4.0
Created on
8/4/2009 8:08:14 AM in
Design and CSS styles