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;
}
}