From within my (2011 SP1) TBB I need to know when a TextField
object is rich text or plain text so I can process the contents differently, but I dont see any simple way to find this out. Is this possible without going into the schema XSD?
1 Answer
You could check to see if the ItemField type is a XhtmlField.
if (itemField is XHtmlField)
{
// Is Rich Text Field
}
else if (itemField is TextField)
{
// Is Text Field
}
else
{
...
}
-
+1! I'd never noticed this ItemField subclass - probably because it's at the bottom of the list. I was poking around in MultiLineTextField and MultiLineTextFieldDefinition for a property of some kind to find an answer to this :) Apr 29, 2013 at 15:35
-
Thanks Alex - exactly what I was looking for, very relieved its so simple. Apr 30, 2013 at 18:47