tags:

views:

142

answers:

1

Can anyone tell me how i can find out if an SPField object is a rich text box or a normal text box. If its a rich text box then i want to use the GetFieldValueAsHtml otherwise i want to use the GetFieldValueAsText methods.

I have looked at SPField.Type but i am either blind (very possible) or it just has a Text option that represents all Text field.

Thanks in advance

+2  A: 

Can you use the TypeAsString property? Others seem to have had issues finding the type.

string fieldType = spField.TypeAsString;
BrianLy
That doesn't really work. I have found that multi line text boxes are SPFieldType.Note so if the field is this i am using the HTml return otherwise i return thevalue as Text
Paul