1

I am new to SharePoint developement and need a little help to create a custom filed type. I am building the field with WPS builder. I have created a project and it is compiling just fine. However I have a problem figuring out how to save the selected value from a drop down list to the custom field value.

Is there a special method to save this value or how is this usually done?

Here is my solution:

  • SuperLookup3.cs
  • SuperLookup3Control.cs
  • SuperLookup3FieldEditor.cs
  • SuperLookup3FieldEditor.ascx (CONTROLTEMPLATES)
  • fldtypes_SuperLookup3.xml (XML)

BR

1

In your class, that inherits from BaseFieldControl (I suppose this is the SuperLookup3Control) you need to override Value property. Getter will be fire when you save new (or edit) item. Value, that your getter returned will be saved as field value for this particular item. Setter, on the other hand, intended to setup field value from item and display it in some way on UI.

Look at BaseFieldControl members, there are couple of properties and methods whick may be very useful (ControlMode, Field, ItemFieldValue, TemplateContainer).

If you want to see an example, you can find field type projects on codeplex, download it and investigate code. (For example this one)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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