Tell me more ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am trying to create a custom multicolumn field type for SharePoint 2010. Everything looks great when you create a new Item that has that field type assigned. The problem is once I save the item and then display it, I only see the First value. If I edit the item I see all the correct values in the custom control I made for that new field type.

Any Thoughts??

Here is the code I am using:

 public class AmountWithUnitsofMeasure : SPFieldMultiColumn
{
    public AmountWithUnitsofMeasure(SPFieldCollection fields, string fieldName) : base(fields, fieldName) { }
    public AmountWithUnitsofMeasure(SPFieldCollection fields, string typeName, string displayName) : base(fields, typeName, displayName) { }

    public override BaseFieldControl FieldRenderingControl
    {
        get
        {
            BaseFieldControl ctr = new AmountWithUnitsofMeasureFieldControl();
            ctr.FieldName = this.InternalName;
            return ctr;
        }
    }

    public override string GetFieldValueAsHtml(object value)
    {
        SPFieldMultiColumnValue mcv = new SPFieldMultiColumnValue(value.ToString());
        string FullValue = mcv[0].ToString() + "  " + mcv[1].ToString();
        return FullValue;
    }
}
share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

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