This project is read-only.
1

Resolved

Lack of "Decimals" property for fields (used in fields of type Number)

description

Lack of "Decimals" property for fields (used in fields of type Number)

comments

tore7506 wrote Mar 31, 2011 at 12:38 PM

Noted! :-)

You can use the AddDynamicProperty in the InitializeDefinition method of the managed field declaration.
Example:
[SPGENField(ID = "{0F446684-CFD9-475E-BB03-A67D42E17C92}", DisplayName = "My decimal field", Type = SPFieldType.Number)]
public class MyDecimalField: SPGENField<MyDecimalField, SPFieldNumber, double?>
{
    protected override void InitializeDefinition(SPGENFieldProperties<SPFieldNumber> properties)
    {
        properties.AddDynamicProperty(p => p.DisplayFormat, SPNumberFormatTypes.OneDecimal);
    }
}
If this was not the property you refered to in your question, could it be another property in the SPFieldNumber class? The CAML attributes doesn't always match the OM unfortunately.

Haven't had any time yet to complete the decoumentation for this feature.

/Tony

wrote Jul 3, 2011 at 11:31 PM

wrote Feb 14, 2013 at 3:13 AM

wrote May 16, 2013 at 8:49 AM

wrote May 16, 2013 at 8:49 AM

wrote Jun 14, 2013 at 7:55 AM