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

RadExpressionEditor Control template problem with RadTreeView control

1 Answer 91 Views
ExpressionEditor
This is a migrated thread and some comments may be shown as answers.
Nedeltcho
Top achievements
Rank 1
Nedeltcho asked on 25 Sep 2012, 03:59 AM
Hello,

I am having a problem when I try to specialize the control template of the RadExpressionEditor, so I serialized the default template of the control to an XML file and then pasted that in as the control template (see Xaml below). The problem is that one of the parts, which is a RadTreeView control,  cannot be found. It should be in the Telerik.Windows.Controls.Navigation.dll but even after I include the dll the compiler cannot find it. I am using version 2012.2.730.40 for all dlls.

<UserControl x:Class="Runge.Modules.HaulNetworkVisualization.Controls.ExpressionEditor.ExpressionEditorControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:Telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Expressions" 
             xmlns:Expressions="clr-namespace:Telerik.Windows.Controls.Expressions;assembly=Telerik.Windows.Controls.Expressions" 
             xmlns:Controls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" 
             xmlns:NavigationControls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation" 
             xmlns:diag="clr-namespace:System.Diagnostics;assembly=WindowsBase"
             mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <Telerik:RadExpressionEditor x:Name="expressionEditor" ExpressionChanged="ExpressionEditorExpressionChanged" >            
            <Telerik:RadExpressionEditor.Template>
                <ControlTemplate>
                    <Border BorderThickness="{TemplateBinding Border.BorderThickness}" BorderBrush="{TemplateBinding Border.BorderBrush}" Name="PART_RootElement">
                        <Grid Background="{TemplateBinding Panel.Background}" Name="PART_ExpressionEditorGrid">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="3*" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <Expressions:ExpressionTextBox FontSize="12" Name="PART_ExpressionNodeEditor" Grid.Row="0" Controls:StyleManager.Theme="Office_Black" />
                            <Border BorderThickness="0,1,0,0" BorderBrush="{TemplateBinding Border.BorderBrush}" Name="CalculationPanel" Grid.Row="1">
                                <Border.Background>
                                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                        <LinearGradientBrush.GradientStops>
                                            <GradientStop Color="#FFFFFFFF" Offset="0" />
                                            <GradientStop Color="#FFCDCDCD" Offset="1" />
                                            <GradientStop Color="#FFCECECE" Offset="0.42" />
                                            <GradientStop Color="#FFAFAFAF" Offset="0.43" />
                                        </LinearGradientBrush.GradientStops>
                                    </LinearGradientBrush>
                                </Border.Background>
                                <StackPanel Orientation="Horizontal" Margin="4,4,4,4" HorizontalAlignment="Center" VerticalAlignment="Stretch">
                                    <Controls:RadButton InnerCornerRadius="0,0,0,0" CommandParameter="+" Name="Plus" Width="18" Height="18" Controls:StyleManager.Theme="Office_Black">
                                        <Controls:RadButton.Command>
                                            <RoutedUICommand Text="Insert text" />
                                        </Controls:RadButton.Command>
                                        <Path Data="F1M12.488,5.1L10.967,3.579 8,6.545 5.034,3.579 3.512,5.1 6.479,8.066 3.512,11.033 5.034,12.555 8,9.588 10.967,12.554 12.488,11.033 9.521,8.066z" Stretch="Fill" Fill="#FF000000" Width="8" Height="8" RenderTransformOrigin="0.5,0.5" SnapsToDevicePixels="True">
                                            <Path.RenderTransform>
                                                <TransformGroup>
                                                    <TransformGroup.Children>
                                                        <RotateTransform Angle="-45" />
                                                    </TransformGroup.Children>
                                                </TransformGroup>
                                            </Path.RenderTransform>
                                        </Path>
                                    </Controls:RadButton>
                                    <Controls:RadButton InnerCornerRadius="0,0,0,0" CommandParameter="-" Name="Minus" Width="18" Height="18" Margin="1,0,0,0" Controls:StyleManager.Theme="Office_Black">
                                        <Controls:RadButton.Command>
                                            <RoutedUICommand Text="Insert text" />
                                        </Controls:RadButton.Command>
                                        <Path Data="F1M5.0339999,3.579L3.5120001,5.0999999 10.967,12.554 12.488,11.033z" Stretch="Fill" Fill="#FF000000" Width="8" Height="8" RenderTransformOrigin="0.5,0.5" SnapsToDevicePixels="True">
                                            <Path.RenderTransform>
                                                <TransformGroup>
                                                    <TransformGroup.Children>
                                                        <RotateTransform Angle="-45" />
                                                    </TransformGroup.Children>
                                                </TransformGroup>
                                            </Path.RenderTransform>
                                        </Path>
                                    </Controls:RadButton>
                                    <Controls:RadButton InnerCornerRadius="0,0,0,0" CommandParameter="*" Name="Multiply" Width="18" Height="18" Margin="1,0,0,0" Controls:StyleManager.Theme="Office_Black">
                                        <Controls:RadButton.Command>
                                            <RoutedUICommand Text="Insert text" />
                                        </Controls:RadButton.Command>
                                        <Path Data="F1M12.488,5.1L10.967,3.579 8,6.545 5.034,3.579 3.512,5.1 6.479,8.066 3.512,11.033 5.034,12.555 8,9.588 10.967,12.554 12.488,11.033 9.521,8.066z" Stretch="Fill" Fill="#FF000000" Width="8" Height="8" SnapsToDevicePixels="True" />
                                    </Controls:RadButton>
                                    <Controls:RadButton InnerCornerRadius="0,0,0,0" CommandParameter="/" Name="Divide" Width="18" Height="18" Margin="1,0,0,0" Controls:StyleManager.Theme="Office_Black">
                                        <Controls:RadButton.Command>
                                            <RoutedUICommand Text="Insert text" />
                                        </Controls:RadButton.Command>
                                        <Path Data="M6.4999404,5.0003071C7.3283672,5.0003071 7.9999404,5.6718798 7.9999404,6.5003071 7.9999404,7.3287339 7.3283672,8.0003071 6.4999404,8.0003071 5.6715131,8.0003071 4.9999404,7.3287339 4.9999404,6.5003071 4.9999404,5.6718798 5.6715131,5.0003071 6.4999404,5.0003071z M1.5,0.00036684913C2.3284271,0.0003668053 3,0.67193967 3,1.5003668 3,2.3287938 2.3284271,3.0003667 1.5,3.0003667 0.67157286,3.0003667 0,2.3287938 0,1.5003668 0,0.67193967 0.67157286,0.0003668053 1.5,0.00036684913z M6.6609359,0L8.016551,1.3556148 1.3730572,8 0.016551096,6.6434937z" Stretch="Fill" Fill="#FF000000" Width="8" Height="8" RenderTransformOrigin="0.5,0.5" SnapsToDevicePixels="True">
                                            <Path.RenderTransform>
                                                <TransformGroup>
                                                    <TransformGroup.Children>
                                                        <RotateTransform Angle="-133.675" />
                                                    </TransformGroup.Children>
                                                </TransformGroup>
                                            </Path.RenderTransform>
                                        </Path>
                                    </Controls:RadButton>
                                    <Controls:RadButton InnerCornerRadius="0,0,0,0" CommandParameter="%" Name="Percent" Width="18" Height="18" Margin="1,0,0,0" Controls:StyleManager.Theme="Office_Black">
                                        <Controls:RadButton.Command>
                                            <RoutedUICommand Text="Insert text" />
                                        </Controls:RadButton.Command>
                                        <Path Data="M6.5,5C7.3284268,5 8,5.6715727 8,6.5 8,7.3284268 7.3284268,8 6.5,8 5.6715727,8 5,7.3284268 5,6.5 5,5.6715727 5.6715727,5 6.5,5z M6.6443858,0L8,1.355615 1.3565066,8.000001 3.5762793E-07,6.6434941z M1.5,0C2.3284271,0 3,0.67157286 3,1.4999999 3,2.3284271 2.3284271,2.9999998 1.5,2.9999998 0.67157286,2.9999998 6.412975E-08,2.3284271 0,1.4999999 6.412975E-08,0.67157286 0.67157286,0 1.5,0z" Stretch="Fill" Fill="#FF000000" Width="8" Height="8" SnapsToDevicePixels="True" />
                                    </Controls:RadButton>
                                    <Controls:RadButton InnerCornerRadius="0,0,0,0" CommandParameter="=" Name="Equals" Width="18" Height="18" Margin="10,0,0,0" Controls:StyleManager.Theme="Office_Black">
                                        <Controls:RadButton.Command>
                                            <RoutedUICommand Text="Insert text" />
                                        </Controls:RadButton.Command>
                                        <Path Data="M0,3L9,3 9,5 0,5z M2.682209E-07,0L9,0 9,2 2.682209E-07,2z" Stretch="Fill" Fill="#FF000000" Width="8" Height="5" SnapsToDevicePixels="True" />
                                    </Controls:RadButton>
                                    <Controls:RadButton InnerCornerRadius="0,0,0,0" CommandParameter="&lt;&gt;" Name="NotEquals" Width="18" Height="18" Margin="1,0,0,0" Controls:StyleManager.Theme="Office_Black">
                                        <Controls:RadButton.Command>
                                            <RoutedUICommand Text="Insert text" />
                                        </Controls:RadButton.Command>
                                        <Path Data="M6.8438272,0L6.0373545,2.0623121 8,2.0623121 8,4.0623121 5.2552485,4.0623121 4.8641958,5.0623121 8,5.0623121 8,7.0623121 4.0820904,7.0623121 3.2790608,9.115819 1.1248636,9.0938644 1.9289982,7.0623121 0,7.0623121 0,5.0623121 2.7206435,5.0623121 3.116466,4.0623121 2.7167258E-07,4.0623121 2.7167258E-07,2.0623121 3.9081113,2.0623121 4.7207074,0.0093827248z" Stretch="Fill" Fill="#FF000000" Width="8" Height="9" SnapsToDevicePixels="True" />
                                    </Controls:RadButton>
                                    <Controls:RadButton InnerCornerRadius="0,0,0,0" CommandParameter="&lt;" Name="LessThan" Width="18" Height="18" Margin="7,0,0,0" Controls:StyleManager.Theme="Office_Black">
                                        <Controls:RadButton.Command>
                                            <RoutedUICommand Text="Insert text" />
                                        </Controls:RadButton.Command>
                                        <Path Data="F1M14.10388,3.5915833L10.967,3.579 6.4790001,8.066 10.967,12.554 14.128588,12.56459 9.5209999,8.066z" Stretch="Fill" Fill="#FF000000" Width="6" Height="8" SnapsToDevicePixels="True" />
                                    </Controls:RadButton>
                                    <Controls:RadButton InnerCornerRadius="0,0,0,0" CommandParameter="&lt;=" Name="LessThanOrEquals" Width="18" Height="18" Margin="1,0,0,0" Controls:StyleManager.Theme="Office_Black">
                                        <Controls:RadButton.Command>
                                            <RoutedUICommand Text="Insert text" />
                                        </Controls:RadButton.Command>
                                        <Path Data="M7.0000005,5L12.000001,5 12.000001,7 7.0000005,7z M7.0000005,1.9999996L12.000001,1.9999996 12.000001,3.9999998 7.0000005,3.9999998z M3.5201895,0L5.9806204,0.011203052 2.3860106,3.9948406 6,8.000001 3.5201895,7.9905715 0,3.9948406z" Stretch="Fill" Fill="#FF000000" Width="12" Height="8" SnapsToDevicePixels="True" />
                                    </Controls:RadButton>
                                    <Controls:RadButton InnerCornerRadius="0,0,0,0" CommandParameter="&gt;=" Name="GreaterThanOrEquals" Width="18" Height="18" Margin="1,0,0,0" Controls:StyleManager.Theme="Office_Black">
                                        <Controls:RadButton.Command>
                                            <RoutedUICommand Text="Insert text" />
                                        </Controls:RadButton.Command>
                                        <Path Data="M0,4L5,4 5,6 0,6z M0,0.99999988L5,0.99999988 5,3 0,3z M9.5201912,0L11.980621,0.011203052 8.3860121,3.9948406 12.000002,8.000001 9.5201912,7.9905715 6.0000014,3.9948406z" Stretch="Fill" Fill="#FF000000" Width="12" Height="8" Margin="-1,-1,-1,-1" RenderTransformOrigin="0.5,0.5" SnapsToDevicePixels="True">
                                            <Path.RenderTransform>
                                                <TransformGroup>
                                                    <TransformGroup.Children>
                                                        <RotateTransform Angle="-180" />
                                                    </TransformGroup.Children>
                                                </TransformGroup>
                                            </Path.RenderTransform>
                                        </Path>
                                    </Controls:RadButton>
                                    <Controls:RadButton InnerCornerRadius="0,0,0,0" CommandParameter="&gt;" Name="GreaterThan" Width="18" Height="18" Margin="1,0,0,0" Controls:StyleManager.Theme="Office_Black">
                                        <Controls:RadButton.Command>
                                            <RoutedUICommand Text="Insert text" />
                                        </Controls:RadButton.Command>
                                        <Path Data="F1M14.10388,3.5915833L10.967,3.579 6.4790001,8.066 10.967,12.554 14.128588,12.56459 9.5209999,8.066z" Stretch="Fill" Fill="#FF000000" Width="6" Height="8" RenderTransformOrigin="0.5,0.5" SnapsToDevicePixels="True">
                                            <Path.RenderTransform>
                                                <TransformGroup>
                                                    <TransformGroup.Children>
                                                        <RotateTransform Angle="-180" />
                                                    </TransformGroup.Children>
                                                </TransformGroup>
                                            </Path.RenderTransform>
                                        </Path>
                                    </Controls:RadButton>
                                    <Controls:RadButton InnerCornerRadius="0,0,0,0" CommandParameter="And" Foreground="#FF000000" Padding="0,0,0,0" Name="And" Width="29" Height="18" Margin="10,0,0,0" Controls:StyleManager.Theme="Office_Black">
                                        <Controls:RadButton.Command>
                                            <RoutedUICommand Text="Insert text" />
                                        </Controls:RadButton.Command> And
                                    </Controls:RadButton>
                                    <Controls:RadButton InnerCornerRadius="0,0,0,0" CommandParameter="Or" Foreground="#FF000000" Padding="0,0,0,0" Name="Or" Width="29" Height="18" Margin="1,0,0,0" Controls:StyleManager.Theme="Office_Black">
                                        <Controls:RadButton.Command>
                                            <RoutedUICommand Text="Insert text" />
                                        </Controls:RadButton.Command> Or
                                    </Controls:RadButton>
                                    <Controls:RadButton InnerCornerRadius="0,0,0,0" CommandParameter="Not" Foreground="#FF000000" Padding="0,0,0,0" Name="Not" Width="29" Height="18" Margin="1,0,0,0" Controls:StyleManager.Theme="Office_Black">
                                        <Controls:RadButton.Command>
                                            <RoutedUICommand Text="Insert text" />
                                        </Controls:RadButton.Command> Not
                                    </Controls:RadButton>
                                </StackPanel>
                            </Border>
                            <Grid Grid.Row="2">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="*" />
                                </Grid.ColumnDefinitions>
                                <NavigationControls:RadTreeView IsLineEnabled="True" IsVirtualizing="False" BorderBrush="#FF848484" BorderThickness="0,1,1,1" Name="PART_EditorCategoriesTree" AllowDrop="True" Grid.Column="0" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto" Controls:StyleManager.Theme="Office_Black">
                                    <NavigationControls:RadTreeView.ItemTemplate>
                                        <HierarchicalDataTemplate ItemsSource="{Binding Path=ChildCategories}" ItemTemplate="{x:Null}" ItemTemplateSelector="{x:Null}" ItemContainerStyle="{x:Null}" ItemContainerStyleSelector="{x:Null}" ItemStringFormat="{x:Null}" AlternationCount="0" ItemBindingGroup="{x:Null}">
                                            <TextBlock Text="" />
                                        </HierarchicalDataTemplate>
                                    </NavigationControls:RadTreeView.ItemTemplate>
                                </NavigationControls:RadTreeView>
                                <NavigationControls:RadTreeView IsVirtualizing="False" DisplayMemberPath="Name" BorderBrush="#FF848484" BorderThickness="0,1,0,1" FontWeight="Bold" Name="PART_EditorItemsTree" AllowDrop="True" Grid.Column="1" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto" Controls:StyleManager.Theme="Office_Black" />
<!--                                <TreeView BorderBrush="#FF848484" BorderThickness="0,1,1,1" Name="PART_EditorCategoriesTree" AllowDrop="True" Grid.Column="0" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto" Controls:StyleManager.Theme="Office_Black">-->
<!--                                            <TreeView.ItemTemplate>-->
<!--                                                <HierarchicalDataTemplate ItemsSource="{Binding Path=ChildCategories}" ItemTemplate="{x:Null}" ItemTemplateSelector="{x:Null}" ItemContainerStyle="{x:Null}" ItemContainerStyleSelector="{x:Null}" ItemStringFormat="{x:Null}" AlternationCount="0" ItemBindingGroup="{x:Null}">-->
<!--                                                    <TextBlock Text="" />-->
<!--                                                </HierarchicalDataTemplate>-->
<!--                                            </TreeView.ItemTemplate>-->
<!--                                 </TreeView>-->                            
                                <TreeView DisplayMemberPath="Name" BorderBrush="#FF848484" BorderThickness="0,1,0,1" FontWeight="Bold" Name="PART_EditorItemsTree" AllowDrop="True" Grid.Column="1" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto" Controls:StyleManager.Theme="Office_Black" />
                            </Grid>
                            <Border BorderThickness="0,1,0,0" BorderBrush="#FFFFFFFF" Background="#FFBFBFBF" Name="EditorInfoPanel" Height="75" Grid.Row="3">
                                <Grid Margin="5,5,5,5">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto" />
                                        <RowDefinition Height="*" />
                                    </Grid.RowDefinitions>
                                    <TextBlock Text="" FontWeight="Bold" Foreground="#FF000000" />
                                    <TextBlock Text="" Foreground="#FF000000" TextWrapping="Wrap" Grid.Row="1" />
                                </Grid>
                            </Border>
                            <Border BorderThickness="0,1,0,0" BorderBrush="#FF848484" Name="EditorResultsPanel" Grid.Row="4">
                                <Border.Background>
                                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                        <LinearGradientBrush.GradientStops>
                                            <GradientStop Color="#FFB5B5B5" />
                                            <GradientStop Color="#FFF0F0F0" Offset="0.5" />
                                        </LinearGradientBrush.GradientStops>
                                    </LinearGradientBrush>
                                </Border.Background>
                                <StackPanel Orientation="Horizontal" Margin="6,6,6,6">
                                    <TextBlock Text="Result preview:" Foreground="#FF000000" HorizontalAlignment="Right" />
                                    <TextBlock Text="{Binding FooterText, Mode=TwoWay, diag:PresentationTraceSources.TraceLevel=High}" Foreground="#FF000000" TextAlignment="Left"  />
                                </StackPanel>
                            </Border>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Telerik:RadExpressionEditor.Template>
        </Telerik:RadExpressionEditor>
    </Grid>
</UserControl>

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 25 Sep 2012, 05:21 AM
Hi,

 Can you send us this project (via support ticket) to check locally what's going on?

All the best,
Vlad
the Telerik team

Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

Tags
ExpressionEditor
Asked by
Nedeltcho
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or