Formatting Text in RadControls for WinForms Q3 2009

Thursday, October 29, 2009 by WinForms Team | Comments 7

I am happy to announce a few new features coming in Q3 2009, related to text formatting. As you know, a couple of releases ago we added a feature called Html-like text formatting to our controls:

 

 

Although we supported a very limited and basic set of HTML tags, our clients were happy with having the option to format text via HTML. We received a great deal of feedback on this feature, including many requests to support more HTML tags. Q3 2009 (the beta is coming out this week), comes with support for new tags in our parsing and rendering engine. The most important additions are support for images (local or from resource), lists (bulleted and numbered) and span. We also added relative font sizes and strikethrough. Additionally we added limited support for the style attribute in the span tag, plus the following CSS properties: font-family, font-size, color, and background-color. The list of supported tags is really a small subset of html which we believe covers almost all needed scenarios.

While the previous tags were not exactly html, the new tags are a subset of html. Here is a comprehensive list (including the old tags) of the HTML tags that we now support: <html>, <font>, <color>, <size>, <b>, <strong>, <i>, <em>, <u>, <br>,  <p>, <span>, <ol>, <ul>, <li>, <strike>, <a>, <img>, all respective closing tags.

The HTML-like text formatting is available on a framework level, which means that you can format any text element in our controls. Suppose that you need to underline a specific word in a button, to make it stand out, for example “Click me and keep me pressed”. This can be achieved directly in the Text property of the button by using the following markup:

<html>Click me and <b>keep me pressed</b>

OR

<html>Click me and <strong>keep me pressed</strong>

So far, so good. But how do you pass this functionality to your end user? Also, how would you know whether a particular tag is supported?

This is where the biggest new feature comes in. Yes, this is a new editor (RadMarkupEditor) for formatting text:

 


 

RadMarkupEditor is *not* a standalone control. Rather, the HTML-like text formatting is available on a framework level, which means that you can format any text element in our controls. It has been added on framework level to simplify the way users and developers edit text in HTML markup. The editor supports two views: Design and Markup. In Design view you will be able to edit your Text without writing HTML, and in Markup view you will see the generated HTML and edit it as needed.

The editor provides an intuitive and easy to use Ribbon interface and can be used both at design-time and runtime. Here is a code sample demonstrating how you can use it at Run Time:

RadMarkupDialog dialog = new RadMarkupDialog();
DialogResult result = dialog.ShowDialog();
 
if (result == DialogResult.OK)
{
    MessageBox.Show(dialog.Value);
}

 

A natural question emerges from this – what will happen if we copy and paste HTML content, created with RadEditor for ASP.NET? Well, the results will be mixed so we would not recommend doing this. Most of the content will show, because we use the IE engine to render the HTML. However, styling will be gone, because CSS is not supported. Also, forget about loading images located on the internet or editing these table in WYSIWYG manner.

The new HTML features will be introduced in the upcoming beta and will be officially released in Q3 2009.

Do you think the editor will be helpful in your application? Would you rather see a RTF implementation than HTML? Feel free to leave a comment here or contact us through our support system.
 

7 Comments

  • Joakim 22 Oct 2009
    We have been looking forward to the editor for quite some time. It was first announced as a planed feature ~3 years ago in the forums. It's going to be fun to try it out!
  • Nick 22 Oct 2009
    Thank you for your feedback. Please share with us how you plan to use RadMarkupDialog in your applications.
  • a 22 Oct 2009
    I would like to see the "MarkupEditor" as control ... but anyway thumbs up!
  • Phil 05 Nov 2009
    Nice, but since its not a replacement for your ASP.net XHTML editor, I'd rather have a WinForms version of that.
  • Greg 05 Nov 2009
    This is an excellent start. I would second the desire for this to be a control. I would also would like to recommend that styles be supported.  Please, no RFT.  I'd really like a full featured, bindable HTML editor control. Thanks!
  • Nick 17 Dec 2009
    @Phil: We are thinking about this, but no plans are set for a stand-alone RTF/XHTML editor.

    @Greg: Thank you for your feedback about XHTML and RTF. What about the rest of you guys. Do you prefer XHTML over RTF?
  • Arve Asheim 11 Jun 2010
    RTF or HTML basically depends what kind of application you are making.
    HTML should be first priority, but RTF would be welcomed also on a later time.
    Some of us need to be able to set the allowed HTML tags, so that no other tags can be used, this would be a great feature.
    Second the suggestion this should be a control also.

Add comment

  1. Formatting options
       
     
     
     
     
       
  2. (optional, emails won't be shown on public pages)
  3. (optional)