0

I'm currently creating a custom field type and I've followed all the online tutorials to create an edit control and I'm able to customize the "Additional Column Settings" area without any issues.

Is there a way to create additional sections for editing the field other then "Additional Column Settings"? For instance, Managed Metadata fields have: - Additional Column Settings - Multiple Value Field - Display Forma - ...

1 Answer 1

2

That's ultimately dictated by the FieldEditor user control you reference. Here's an example for a custom SPField I recently worked on:

    <wssuc:InputFormSection Title="reCAPTCHA Column Settings" Description="Specify your public and private reCAPTCHA keys along with selecting a theme and default language. For more information on reCAPTCHA and to obtain your own keys go to http://www.recaptcha.com" runat="server">
        <Template_InputFormControls>
            <wssuc:InputFormControl LabelText="Public Key" runat="server">
                <Template_Control>
                    <wssawc:InputFormTextBox Title="Public Key" class="ms-input" ID="rcPublicKey" Columns="40" Runat="server" />
                </Template_Control>
            </wssuc:InputFormControl>
            <wssuc:InputFormControl LabelText="Private Key" runat="server">
                <Template_Control>
                    <wssawc:InputFormTextBox Title="Private Key" class="ms-input" ID="rcPrivateKey" Columns="40" Runat="server" />
                </Template_Control>
            </wssuc:InputFormControl>
            <wssuc:InputFormControl LabelText="Theme" runat="server">
                <Template_Control>
                    <asp:DropDownList runat="server" ID="rcTheme">
                    </asp:DropDownList>
                </Template_Control>
            </wssuc:InputFormControl>
            <wssuc:InputFormControl LabelText="Language" runat="server">
                <Template_Control>
                    <asp:DropDownList runat="server" ID="rcLanguage">
                    </asp:DropDownList>
                </Template_Control>
            </wssuc:InputFormControl>
        </Template_InputFormControls>
    </wssuc:InputFormSection>

If I wanted another section to show up I would just add another InputFormSection and then add whatever controls I wanted within that section. The use of the InputForm... controls handles all the layout and formatting for you.

3
  • Thanks for the reply. This works in WSS 3.0 but it does not seem to work in 2010 for me. Do you have an example of a 2010 implementation?
    – RWL01
    Commented Aug 10, 2011 at 14:07
  • This is an example from a 2010 project I just completed. Full source for the project can be found at recaptchaforsp.codeplex.com under Downloads.
    – Rob D'Oria
    Commented Aug 10, 2011 at 14:14
  • This was my mistake, it works. I needed to modify my DisplayAsNewSection to return "true" in my editor control's class. Its working as expected now. Thanks
    – RWL01
    Commented Aug 10, 2011 at 14:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.