Blogs

Gary's Blog

XAF – Applying HTML Formatting to Windows Forms UI Elements

     

XAF uses controls from the XtraEditors suite to build windows forms UI elements. Now, some of these XtraEditor controls allow XAF to format the display text using HTML. So, which of these editors can be formatted using HTML?

  • Static Text Detail View Item's text.
  • Property Editor's captions in Detail Views.
  • Column captions of the Windows Forms GridListEditor.
    By default, XAF uses this List Editor to visualize List Views in Windows Forms applications.

XAF allows these three elements to be customized via the associated attributes of the Application Model. A complete list of the HTML tags that you can use can be found here. Of course, you can switch the ability to format the display text in this way via the EnableHTMLFormatting attribute of the Application Model's Application | Options node.

Okay, so let’s have an example or two. Firstly, let’s look at the Static Text Detail View Item's text. Set the Caption attribute of the Application Model's Application | Views | Contact_DetailView | Items | WebPageAddress node to the following value:

<size=12><color=red><b>Web </b><color=0,255,0><i>Page </i><color=#0000FF><u>Address</u></color></size>

The following image shows part of the resulting Contact Detail View:

Now let’s have a look at the column's caption of the default list editor. Set the Caption attribute of the Application Model's Application | Views | Contact_ListView | Columns | LastName node to the following value:

<size=10><color=#CFCAFF><size=+4>L<color=#B0A8FF><size=+4>A<color=#6F79FF><size=+4>S<color=#4D3EFF><size=+4>T <color=#4D3EFF><size=-4>N<color=#6F79FF><size=-4>A<color=#B0A8FF><size=-4>M<color=#CFCAFF><size=-4>E</color></size>

The following image shows the resulting Contact List View:

This is yet another example of how, by leveraging other Developer Express controls, XAF makes you life as a developer easier and you more productive.

Digg This
Published Mar 19 2009, 04:52 PM by Gary Short (DevExpress)
Filed under:
Technorati tags: XAF
Bookmark and Share

Comments

 

Steven Rasmussen said:

These features are an added welcome.  Are there any plans to make all the editors support this basic HTML functionality?  For example, I am writing an IMAP email client similar to Outlook 2007.  In the treeview list of all the folders, it would be nice to be able to have similar formatting of the text of the folder name.  You will notice that if a folder contains 'unread' items, the name of the folder is bold and the number of items is blue.

March 19, 2009 3:41 PM
 

John Pattison said:

I had one customer suggest applying formatting to the list of reports in XAF.  The scenario is that the customer has a number of categories of reports and wants to classify them in a manner that's easy to see.  It doesn't appear to me that you can apply formatting to the list of reports, or am I missing that?

March 19, 2009 3:51 PM
 

Robert Fuchs said:

This is nice but not of much use when it is static.

Can this be applied conditionally?

eg. in pseudo code:

<color=discontinued?lightgrey:black>Name</color>

March 19, 2009 9:20 PM
 

John Botibol said:

Hi Robert

I think this is actually very useful even when static when taken in the context of Mark Miller's fascinating series of blogs regarding "Great UI:". This enables quite a lot of the features discussed especially emphasis on text which matters through use of opacity and prominence.

March 20, 2009 5:26 AM
 

Robert Fuchs said:

@John: Mark is right and you are right.

But as we are talking about XAF here - a framework for business apps - the primary goal must be: how do we adjust "emphasis on text which matters" according to business rules? Business rules are dynamic in nature, so this static stuff does not help at all. It is a very nice gimmick - but nothing more.

March 20, 2009 6:22 PM
More from DevExpress
Live Chat
Have a pre-sales question?
Need assistance with your evaluation?
We are here to help.
Chat is one of the many ways you can contact members of the DevExpress Team. We are available Monday-Friday between 8:30am and 5:00pm Pacific Time.
If you need additional product information, require pre-sales assistance, or want help with your order, write to us at info@devexpress.com or call us at
+1 (818) 844-3383.