Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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

share|improve this question
    
Here is a link to the original question (for potential answerers): stackoverflow.com/q/8558419/180312 –  Stuart Pegg Dec 20 '11 at 9:43

1 Answer 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)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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