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

Help me customize RadDiagramToolBox

3 Answers 117 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
mickey0109
Top achievements
Rank 1
Veteran
mickey0109 asked on 07 Aug 2020, 07:51 AM
Hello, 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.

3 Answers, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 07 Aug 2020, 10:35 AM

Hi Vladimir,

Could you please refer to this section of the documentation and let us know if you have any issues implementing it ?

https://docs.telerik.com/devtools/wpf/controls/raddiagram/extensions/toolbox#configure-a-raddiagramtoolbox-to-display-part-of-the-hierarchicalgalleryitemscollection

Regards,
Petar Mladenov
Progress Telerik

0
mickey0109
Top achievements
Rank 1
Veteran
answered on 07 Aug 2020, 01:54 PM

Thank you for responding to my article.

The current demo source uses the HierarchicalGalleryItemsCollection() function in the MainViewModel.cs file to load items by default.

So, I put the code described in the document in the part that uses the HierarchicalGalleryItemsCollection () function.

However, in document there are two code: C# and XAML.

I put the C# code here.

The items are not displayed in the resulting ToolBox.

Should I put both C# and XAML here? Why?

0
Petar Mladenov
Telerik team
answered on 10 Aug 2020, 02:03 PM

Hi Vladimir,

Yes you need the XAML too, the C# code helps you configure a ViewModel for your page/window which hosts the DiagramToolBox. In the XAML snippet above the mentioned article section, the viewmodl is set a s datacontext of the main root Grid and ItemsSource of the toolbox is bound to the GalleryItems property. These are the main 2 steps you need - datacontext (viewmodel) class set to the toolbox, and itemssource bound to the GalleryItems property of the datacontext. 

Regards,
Petar Mladenov
Progress Telerik

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