How to fetch PropertyOwner in plain text

Discussions related to custom development with Select.
Post Reply
abhijit
Posts: 5
Joined: Mon Aug 29, 2011 5:37 am

How to fetch PropertyOwner in plain text

Post by abhijit »

Hello,

We are using following code to get the property owner for an order.

order.Title.Commitment[0].CurrentOwner;

The problem with above is that, if user enter owner information with any styles applied (like BOLD, ITALICS etc.) then what we get is a big long string whcih contains that font/style information as well.

What we want to fetch is plain text that user has entered without any style information, how can we get that?

Thanks
Mark McKenna

Re: How to fetch PropertyOwner in plain text

Post by Mark McKenna »

Some of the field data in Select is stored as RTF in order to retain formatting information. To convert it to plain text, one option is to leverage the RichTextBox .NET type directly, such as:

Code: Select all

string plain = null;
using ( System.Windows.Forms.RichTextBox box = new System.Windows.Forms.RichTextBox( ) )
{
  box.Rtf = yourRtfString;
  plain = box.Text;
}
Post Reply