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

Customizing RadDiagramToolbox

3 Answers 173 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Rajkumar
Top achievements
Rank 1
Rajkumar asked on 27 May 2014, 09:12 AM
The tool box that hold shapes has 3 shapes listed in a row by default

The tool box also assumes a vertical orientation.

If suppose I need to align the tool box on top of the diagram, how can i do it ?

3 Answers, 1 is accepted

Sort by
0
Milena
Telerik team
answered on 30 May 2014, 06:53 AM
Hello Rajkumar,

The RadDiagramToolBox doesn't support placement change out-of-the box (with Placement property or something). Unfortunately, there is not an easy way to change its position. However, you can use an implicit styles and retemplate it:

<Style TargetType="telerik:RadDiagramToolbox" BasedOn="{StaticResource RadDiagramToolboxStyle}" >
     <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerik:RadDiagramToolbox">
                 ...
</Style>
 You can find the file with the style in the solution Themes.Implicit_WPF.sln, which is in installation folder of your version of UI for WPF, the path should be: ..Program Files (x86)\Telerik\UI for WPF Q1 2014\Themes.Implicit\WPF40\Windows8\Themes\Telerik.Windows.Controls.Diagrams.Extensions.xaml

At the moment the tool box is a grid with 2 columns, so as far as I understand, you need to first to replace the columns with rows. For your convenience I implemented this approach in the attached project using Windows8 theme. Please have in mind that you should take care of a lot of details - for example the animation for show/hide the hidable part with gallery groups (it is implemented in the project), close button path, etc.
I hope that this will give you an idea how to customize the tool box further according your requirements. Please feel free to ask if you need any further assistance.

Regards,
Milena
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
mickey0109
Top achievements
Rank 1
Veteran
answered on 07 Aug 2020, 07:43 AM
Hello, I have read this article carefully.
There was a problem raised while I tried to customize the source of radDiagramToolBox Demo, so I came to this courtyard.
In the demo version, the toolbox provides the default items provided by telerik ui control.
However, I want the Toolbox to have only Start, Rectangle, and Decision shape items.
While reading various articles here, I tried using the methods suggested there, but I could not realize this.
Please help me with this.
I am currently using the DiagramToolBox Demo source provided by Telerik UI for WPF.
0
Milena
Telerik team
answered on 10 Aug 2020, 07:31 AM

Hello Vladimir, 

I'm not sure which demo you mean by "DiagramToolBox Demo". However, you can see the attached project to the current post - there you can see how to add a  custom collection of shapes to the Toolbox (see MainViewModel class). Also, you can see the "Configure a RadDiagramToolbox to Display Part of the HierarchicalGalleryItemsCollection" from the help article and see how to add only some of the built-in provided shapes or "How to Populate RadDiagramToolbox with Custom Data Items" which approach is used in the attached here project. 

I hope this information helps.

 

Regards,
Milena
Progress Telerik

Tags
Diagram
Asked by
Rajkumar
Top achievements
Rank 1
Answers by
Milena
Telerik team
mickey0109
Top achievements
Rank 1
Veteran
Share this question
or