This is a migrated thread and some comments may be shown as answers.

Enabling word wrap and encapsulating a bulletgraph in programatically created RadButton

1 Answer 97 Views
Buttons
This is a migrated thread and some comments may be shown as answers.
Peter Litsegård
Top achievements
Rank 1
Peter Litsegård asked on 04 Apr 2013, 01:31 PM
Hi!

I have a WPF application where I create RadButtons on the fly programatically. The content is set to a text. Is it possible to make this text wrap within the boundaries of the button? Furthermore I'd like to be able to include a BulletGraph together with the text, thus being able to give the user a graphical feedback as of the progress of the work being done in the area to which the button is connected. By pressing a given button the user is taken to another screen within the application where they're able to perform activities and the amount of work that has been done should be visually displayed on the button when the user goes back to the "button screen". I thought the BulletGraph would be a great way of displaying this progress.

In other words:

1. Is it possible to allow word-wrap for the RadButton.Content property when the content is text?
2. Is it possible to programatically populate a programatically created RadButton with a RadBulletGraph together with text?

Hmmm, hope this makes sense...:)

Cheers

1 Answer, 1 is accepted

Sort by
0
Pavel R. Pavlov
Telerik team
answered on 09 Apr 2013, 11:24 AM
Hi Peter,

Yes, you can achieve your goal in code behind. You can create a StackPanel and add a TextBlock and a RadHorizontalBulletGraph control in its Children collection. Furthermore, you can set this StackPanel as content of the RadButton control. Finally, you can add this button to your "LayoutRoot" element.

For your convenience I implemented this approach in the attached project. Please take a look at it and let me know if it works for you.

All the best,
Pavel R. Pavlov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Buttons
Asked by
Peter Litsegård
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
Share this question
or