Multicolor text on RadTreeView nodes

2 posts, 0 answers
  1. Kin
    Kin avatar
    3 posts
    Member since:
    Nov 2007

    Posted 01 Dec 2009 Link to this post

    I have a need for short paragraphs on the nodes/leaves of a RadTreeView.  I was readily able to bind a (wrapping) TextBlock's Text to in-memory objects, and all works fine.

    The next step was to get multicolor text, instead of plain text, on these nodes.  Now I have hit a snag ... can't figure out how to use that TextBlock (or what to replace it with) to get bindable multicolor text.  Searching on this a bit, evidently "bindable Run" is a bit of an issue, and won't be resolved until WPF 4.0.

    I'd really appreciate any suggestions that would work, prior to WPF 4.0.  Is there something in the Telerik suite that works around this? 

    Thanks in advance for any help!
  2. Miroslav
    Miroslav avatar
    922 posts

    Posted 03 Dec 2009 Link to this post

    Hi Kin,

    Unfortunately we do not offer a RichText to help you in this case.

    I can only suggest things that you have probably though of already:
    - Bind to several TextBlocks instead of one, this is not very maintainable though.
    - Bind the Content property of a ContentPresenter and use a Converter for the binding (IValueConverter) that will take the required property and generate a TextBlock with the required colored runs.

    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top