HTML text in Silverlight controls with ellipses, tooltip and rollover

One of my colleagues asked about a column in datagrid / itemlist in listbox which is capable of showing HTML.

Over the above requirement there was yet another requirement where in the tooltip over the html text should show plain text within HTML text. The HTML Text may be truncated based on number of characters allowed followed by ellipses(…).

The result was a usercontrol which is capable of:

  1. displaying HTML
  2. displaying ellipses(…) when HTML text is long
  3. displaying tooltip which displays “stripped” down html (plain text)
  4. the control itself fully templatized
  5. Also attached is marquee behaviour which displays rolling text when mouse over on any column.

I also implemented a marquee behaviour so that the text may rollover to display text. here is a snapshot of the output.


and here is the tooltip of the user control


I am including the code here for anyone to use.

Comments / suggestions are welcome.

Technorati Tags: ,