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

How to RadDiagram Toolbox shape in Item area orientation as vertical ?

7 Answers 123 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Hiren
Top achievements
Rank 1
Hiren asked on 12 Sep 2013, 01:28 PM
Hello,

I Required to make the RadDiagramToolBox ItemArea on Vertical so that only one shape can display in one row next shape will be display in second line and so on.

Please find the attached screen shot how it look likes

ToolboxOrignal.Png is the Actually functionaliyt
ToolBoxItemsAreaVertial.png  is what we want to achieve.

Please let me know if you required more information.

Thanks,
Hiren

7 Answers, 1 is accepted

Sort by
0
Pavel R. Pavlov
Telerik team
answered on 17 Sep 2013, 10:42 AM
Hello Hiren,

I am happy to inform you that there is straightforward approach to achieve your requirement. You can try setting the Width property of the RadDiagramToolbox control. If you for example set it to 250 pixels (or something similar) the items in a group will be reordered as you require.

Please try this approach out and let me know if you need any further assistance.

Regards,
Pavel R. Pavlov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Accepted
Kunal Chowdhury
Top achievements
Rank 2
answered on 26 Dec 2013, 09:49 AM
Hi Hiren,

Exactly the same requirement I had and I resolved this by using a small trick. Here I documented the trick in my blog: http://www.kunal-chowdhury.com/2013/12/how-to-set-no-of-columns-in-teleriks.html. Please check it out and let me know, if that worked for you. Mark As Answer if it helped.
0
Marco
Top achievements
Rank 1
answered on 31 Oct 2019, 09:20 AM

This is unfortunaly not working. Do you have an other solution for this problem? It still shows me three columns, now cutted.

 

<telerik:RadDiagramToolbox x:Name="ControlToolbox" 
                                   Width="290"
                                   Title="Controls" 
                                   Header="{Binding SelectedItem.Header, 
                                            RelativeSource={RelativeSource Self}}" 
                                   ItemsSource="{Binding Items}" 
                                   ItemTemplate="{StaticResource ToolboxGroupTemplate}" />

0
Martin Ivanov
Telerik team
answered on 04 Nov 2019, 09:34 AM

Hello Marco,

You are right. Setting the Width doesn't work as expected. Instead, you can use the Kunal's approach. In other words, set the ItemsPanel of RadDiagramToolboxGroup to UnformGrid. For example:

<Window.Resources>
	<Style TargetType="telerik:RadDiagramToolboxGroup">
		<Setter Property="ItemsPanel">
			<Setter.Value>
				<ItemsPanelTemplate>
					<telerik:RadUniformGrid VerticalAlignment="Top" Columns="1" />
				</ItemsPanelTemplate>
			</Setter.Value>
		</Setter>
	</Style>
</Window.Resources>

Regards,
Martin Ivanov
Progress Telerik

Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Marco
Top achievements
Rank 1
answered on 07 Nov 2019, 03:02 PM

Not this lead that the ToolboxGroup is hidden. I have the solution with a HierarchicalDataTemplate as Group Template. maybe this can explain.

 <view:UserControlBase.Resources>
        <!-- Generic toolbox template -->
        <DataTemplate x:Key="ToolboxItemTemplate">
            <telerik:RadDiagramToolboxItem Name="ControlItem" Width="Auto" Background="Transparent">
                <Border BorderThickness="1" 
                    BorderBrush="Black"
                    Background="Transparent">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <Viewbox Width="Auto" MaxWidth="100"  
                            HorizontalAlignment="Center" 
                            VerticalAlignment="Center" 
                            IsHitTestVisible="False"
                            ToolTip="{Binding Presentation.Value.LocationString.Value, Converter={StaticResource StringToResourceConverter}, Mode=OneWay}"
                            Stretch="Uniform">
                            <Image Margin="0"
                                   VerticalAlignment="Top" 
                                   Source="{Binding Presentation.Value.IconResource.Value, Converter={StaticResource StringToResourceConverter}, Mode=OneWay}"
                                   IsHitTestVisible="True" />
                        </Viewbox>
                        <TextBlock Grid.Row="1" 
                                   HorizontalAlignment="Center" 
                                   Padding="1 0" 
                                   Text="{Binding Presentation.Value.PresentableText.Value}" 
                                   TextAlignment="Center" 
                                   FontSize="12"
                                   TextWrapping="Wrap" />
                    </Grid>
                </Border>
            </telerik:RadDiagramToolboxItem>
        </DataTemplate>

        <!-- Generic toolbox template -->
        <DataTemplate x:Key="ToolboxHeader">
            <TextBlock Text="Drop to diagram to add." 
                       FontStyle="Italic"
                       FontSize="9"
                       Foreground="Black" 
                       VerticalAlignment="Center" />
        </DataTemplate>

        <HierarchicalDataTemplate x:Key="ToolboxGroup"
                                  ItemTemplate="{StaticResource ToolboxItemTemplate}"
                                  ItemsSource="{Binding Children}" >
            <StackPanel Orientation="Horizontal">
                <Image Margin="2,2,5,2" Width="20"
                       VerticalAlignment="Top" 
                       Source="{Binding Presentation.Value.IconResource.Value, Converter={StaticResource StringToResourceConverter}, Mode=OneWay}" />
                <TextBlock Text="{Binding Presentation.Value.PresentableText.Value}" 
                           FontWeight="Bold" 
                           Foreground="Black" 
                           VerticalAlignment="Center" />
            </StackPanel>
        </HierarchicalDataTemplate>

       
    </view:UserControlBase.Resources>

    <Grid>
        <!-- Tree area -->
        <ScrollViewer Width="Auto"
                      HorizontalScrollBarVisibility="Auto" 
                      VerticalScrollBarVisibility="Auto"
                      HorizontalAlignment="Left">
            <telerik:RadDiagramToolbox x:Name="ControlToolbox" 
                                   Title="Extended Controls" 
                                   HorizontalAlignment="Left"
                                   Header="{Binding SelectedItem.Presentation.Value.PresentableText.Value, RelativeSource={RelativeSource Self}}" 
                                   HeaderTemplate ="{StaticResource ToolboxHeader}"
                                   ItemsSource="{Binding ToolboxTreeControls.Roots}"
                                   ItemTemplate="{StaticResource ToolboxGroup}"
                                   Visibility="{Binding IsChecked, ElementName=toolboxButton, Converter={StaticResource BooleanToVisibilityConverter}}">
            </telerik:RadDiagramToolbox>
        </ScrollViewer>

    </Grid>
</view:UserControlBase>

0
Martin Ivanov
Telerik team
answered on 12 Nov 2019, 07:24 AM

Hello Marco,

Thank you for sharing your code.

About the hidden RadDiagramToolboxGroup, I will guess that NoXaml dlls are referenced in the project. You can see how to troubleshoot this in the Missing Controls in the UI article. If this is your case, you can show the group by setting the BasedOn property of the Style object.

<Window.Resources>
	<Style TargetType="telerik:RadDiagramToolboxGroup" BasedOn="{StaticResource RadDiagramToolboxGroupStyle}">
		<Setter Property="ItemsPanel">
			<Setter.Value>
				<ItemsPanelTemplate>
					<telerik:RadUniformGrid VerticalAlignment="Top" Columns="1" />
				</ItemsPanelTemplate>
			</Setter.Value>
		</Setter>
	</Style>
</Window.Resources>

Regards,
Martin Ivanov
Progress Telerik

Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Marco
Top achievements
Rank 1
answered on 12 Nov 2019, 11:21 AM
Thank you verry much thsi worked for me.
Tags
Diagram
Asked by
Hiren
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
Kunal Chowdhury
Top achievements
Rank 2
Marco
Top achievements
Rank 1
Martin Ivanov
Telerik team
Share this question
or