Telerik Forums
UI for WPF Forum
0 answers
17 views

When trying to read Telerik rad image button in, Command bar UI ,as Automation element, the Enabled state is always returned as True.

Is this automation property supported by the Telerik image button?

I have tested this using RadRichTextEditor sample demo app provided by Telerik and for automation i have used Coded UI .

I tried to fetch the Enabled state of  DeleteAll button of Review tab as shown in attached figure, which is always true.

Or which property should be used to get the Enabled status.

 

jyostna
Top achievements
Rank 1
 updated question on 08 Sep 2021
1 answer
12 views

When selected objects, like shapes and links between the shapes are dragged, if they are selected they all move together as a group as expected. At the end of the drag, a Drag event is generated and in the DragRoutedEventArgs there's an Items list which indicates which items have been dragged, and in some cases the new position.

If the item being dragged is a shape, then I see a IDragItem with a position value.

If the items is a connection between say two shapes dragged, then I see another IDragItem, however, it's position is always 0, 0

The problem I have is that if the connection is a straight line between shapes then it works fine. However, if the connection has extra points added by the user, then I don't get told about those points. So how do I update the data behind about those points?

Dragging the shapes in the view is working correctly, however there's missing data, so if I save and restore, the extra connection points weren't updated so they show the old position. I'll attach a diagram of what I mean.

Vladimir Stoyanov
Telerik team
 answered on 07 Sep 2021
1 answer
18 views

Hi all,

 


<telerik:RadCartesianChart Grid.Column="0">
                            <telerik:RadCartesianChart.HorizontalAxis>
                                <telerik:CategoricalAxis TickThickness="5" MajorTickInterval="1" MajorTickLength="5" Title="Conc."/>
                                
                            </telerik:RadCartesianChart.HorizontalAxis>
                            <telerik:RadCartesianChart.VerticalAxis>
                                <telerik:LinearAxis Minimum="0" LineDashArray="5, 10, 15" TickThickness="5" Title="OD"/>
                            </telerik:RadCartesianChart.VerticalAxis>

                            <telerik:RadCartesianChart.Series>
                                <telerik:PointSeries x:Name="ChartCurve" CategoryBinding="Concentration" ValueBinding="OpticalDensity">
                                    <telerik:PointSeries.PointTemplate>
                                        <DataTemplate>
                                            <Ellipse Width="10" Height="10" Fill="{StaticResource DarkGray}"/>          
                                        </DataTemplate>
                                    </telerik:PointSeries.PointTemplate>
                                </telerik:PointSeries>
                            </telerik:RadCartesianChart.Series>
                            <telerik:RadCartesianChart.Grid>
                                <telerik:CartesianChartGrid MajorLinesVisibility="XY" />
                            </telerik:RadCartesianChart.Grid>
                            <telerik:RadCartesianChart.Annotations>
                                <telerik:CartesianCustomLineAnnotation 
                                       HorizontalFrom="0.0" VerticalFrom="2.25" 
                                       HorizontalTo="20" VerticalTo="10" 
                                       Stroke="{StaticResource DarkGray}"  
                                       StrokeThickness="3" />
                            </telerik:RadCartesianChart.Annotations>
                        </telerik:RadCartesianChart>

1) I try to add a line, doesnt work with

telerik:CartesianCustomLineAnnotation

2)  change position of Title Y axis to top position,  and 3) change position of Title X axis to right.  Doesnt found the way to do it

Thanks in advance for your help

Didier

Dinko
Telerik team
 answered on 06 Sep 2021
2 answers
13 views

Hello folks,

What I want to do :

Draw a RadDiagram with dynamic (dynamic means the custom shapes are not known in advance) custom polygon shapes in MVVM way.

What I tried :

 Firstly, I exclude the MVVM way, and i put this in my View.

<telerik:RadDiagram Height="400" Width="400">
            <telerik:RadDiagramShape x:Name="ConditionShape" 
                Content="condition" 
                FontWeight="Bold" 
                Geometry="{Binding Geometry}" 
                Position="160,80" />
</telerik:RadDiagram>

Geometry property is defined like that :

Polygon p = new Polygon();
p.Stroke = System.Windows.Media.Brushes.Black;
            p.Fill = System.Windows.Media.Brushes.Black;
            p.StrokeThickness = 5;
            p.HorizontalAlignment = HorizontalAlignment.Left;
            p.VerticalAlignment = VerticalAlignment.Center;
            System.Windows.Point Point1 = new System.Windows.Point(1, 50);
            System.Windows.Point Point2 = new System.Windows.Point(10, 80);
            System.Windows.Point Point3 = new System.Windows.Point(50, 50);
            PointCollection myPointCollection = new PointCollection();
            myPointCollection.Add(Point1);
            myPointCollection.Add(Point2);
            myPointCollection.Add(Point3);
            p.Points = myPointCollection;
            this.Geometry = p.RenderedGeometry;

When I do that, I just see the text "condition", but I don't see the polygon.

 

So secondly, I do that :

Create a custom shape control where I add a Points dependencyproperty (points for my polygon).

public class PolygonShape : RadDiagramShape
    {
        public static readonly DependencyProperty PointsProperty = DependencyProperty.Register(nameof(Points), typeof(PointCollection), typeof(PolygonShape));

        public PointCollection Points
        {
            get
            {
                return this.GetValue(PointsProperty) as PointCollection;
            }

            set
            {
                this.SetValue(PointsProperty, value);
            }
        }

        public PolygonShape() : base()
        {

        }
    }

And I set the following style :

<Style TargetType="viewmodels:PolygonShape">
            <Setter Property="HorizontalAlignment" Value="Center" />
            <Setter Property="Margin" Value="0" />
            <Setter Property="Background">
                <Setter.Value>
                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                        <GradientStop Color="White" />
                        <GradientStop Offset="1" Color="#FFEDF4FF" />
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="viewmodels:PolygonShape">
                        <Polygon Points="{TemplateBinding Points}" Stroke="Black" StrokeThickness="4" Fill="Yellow" />
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

This is almost working but I have two problems :

- It is not MVVM way how can I set the collection of shapes to draw (binding between my View and ViewModel)

- When I click on my polygon, the selection is a rectangle and do not follow the borders of my polygon

I guess I'm missing something.

Thanks in advance for your help.

Best regards.


Nicolas
Top achievements
Rank 1
Iron
 answered on 06 Sep 2021
1 answer
26 views

Hi all,

First my view was working with a simple DataGrid. then cutomer asked to have merge cell (MergedCellsDirection=vertical) for some column.
I changed to a RadGridView.

I readed that I can re-use standard template to style the RadGridView, principaly the GridViewRow but i did not found what I needed.

Here the list of points that i want to achieve. (Code Below)


HEADER :

(1) I have disabled the square on the left-top corner, I still have one white pixel left to the first column header.

(2) I have disabled the roll over effect on the header, and I have a rectangle arround the header column label. (Want the header column not clickable)

(3) I want to remove the filtering Icon

ROW :

(4) Same as header, white pixel on left

(5) Dont want row to be selectable

(6) I use MergedCellsDirection="Vertical" (see Cal ID column), and I want a dotted separation between the line.
My code worked with a DataGrid first, then i try to migrate to GridViewRow style .. without success. The cell value doesnt not appear. (the content)

Before (with a RadGrid), the content was displayed with => see style RadGridViewRow_Standard

<DataGridCellsPresenter Grid.Column="1" ItemsPanel="{TemplateBinding ItemsPanel}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>


In advance, Many thanks for your help !

XAML:

<telerik:RadGridView x:Name="GridCalibrators" 
                              
                            BorderBrush="{x:Null}" 
                            BorderThickness="0"
                            AutoGenerateColumns="False"
                            IsReadOnly="True" 
                            CanUserSelect="False"
                            GridLinesVisibility="None" 
                            CanUserReorderColumns="False" 
                            CanUserSortColumns="False" 
                            Background="White"  
                            CanUserSelectColumns="False"
                            ShowGroupPanel="False"        
                            CanUserDeleteRows="False"  
                            CanUserResizeColumns="False" 
                            CanUserResizeRows="False"  
                            RowIndicatorVisibility="Collapsed" 
                            CanUserFreezeColumns="False" 
                            ShowSearchPanel="False"
                            ShowColumnSortIndexes="False"
                            MergedCellsDirection="Vertical"
                            GroupRenderMode="Flat"
                            CanUserSearch="False"
                            CanUserSortGroups="False"
                            HeaderRowStyle="{StaticResource RadGridViewColumnHeaderStyle}"
                            RowStyle="{StaticResource RadGridViewRow_Standard}"
                            Grid.Row="0"
                            >
                        <!--RowStyle="{StaticResource RadGridViewRow_Standard}"-->
                        <telerik:RadGridView.OpacityMask>
                            <VisualBrush Visual="{Binding ElementName=BDRoundedCalibrators}"/>
                        </telerik:RadGridView.OpacityMask>
                        <telerik:RadGridView.Resources>
                            <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#FFFFFF"/>
                            <SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="#5D6467"/>
                            <SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightBrushKey}" Color="#FFFFFF"/>
                            <SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightTextBrushKey}" Color="#5D6467"/>
                        </telerik:RadGridView.Resources>
                        <telerik:RadGridView.Columns>
                            
                            <!-- Status -->
                            <telerik:GridViewDataColumn Header="Status" Width="175" 
                                                        HeaderCellStyle="{StaticResource RadGridViewHeaderCellStyle}" 
                                                        DataMemberBinding="{Binding WellStatus}"
                                                        IsCellMergingEnabled="False">
                                <telerik:GridViewDataColumn.CellTemplate>
                                    <DataTemplate>
                                        <StackPanel Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Center" >
                                            <Image x:Name="IconStatus" Height="37" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="10,0,0,0">
                                                <Image.Style>
                                                    <Style TargetType="{x:Type Image}">
                                                        <Style.Triggers>
                                                            <DataTrigger Value="Completed" Binding="{Binding WellStatus}">
                                                                <Setter Property="Source" Value="{StaticResource AssayApproval_IconCompleted}"/>
                                                            </DataTrigger>
                                                            <DataTrigger Value="Processing" Binding="{Binding WellStatus}">
                                                                <Setter Property="Source" Value="{StaticResource AssayApproval_IconProcessing}"/>
                                                            </DataTrigger>
                                                            <DataTrigger Value="Aborted" Binding="{Binding WellStatus}">
                                                                <Setter Property="Source" Value="{StaticResource AssayApproval_IconAborted}"/>
                                                            </DataTrigger>
                                                        </Style.Triggers>
                                                    </Style>
                                                </Image.Style>
                                            </Image>
                                            <TextBlock Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="10,0,0,0" Text="{Binding WellStatus}"/>
                                        </StackPanel>
                                    </DataTemplate>
                                </telerik:GridViewDataColumn.CellTemplate>
                            </telerik:GridViewDataColumn>

                            <telerik:GridViewPinRowColumn MinWidth="0" Width="1" HeaderCellStyle="{StaticResource RadGridViewColumnSeparatorStyle}" />

                            <!--PlateSerialNumber-->
                            <telerik:GridViewDataColumn  Header="Plate serial number" Width="108" 
                                                         HeaderCellStyle="{StaticResource RadGridViewHeaderCellStyle}" 
                                                         DataMemberBinding="{Binding PlateBarcode}"
                                                         IsCellMergingEnabled="False"/>

                            <telerik:GridViewPinRowColumn MinWidth="0" Width="1" HeaderCellStyle="{StaticResource RadGridViewColumnSeparatorStyle}" />

                            <telerik:GridViewDataColumn  Header="Position" Width="150" 
                                                         HeaderCellStyle="{StaticResource RadGridViewHeaderCellStyle}" 
                                                         DataMemberBinding="{Binding Position}"
                                                         IsCellMergingEnabled="False"/>

..... (only the first columns)

Style file :
    <Style x:Key="RadGridViewColumnSeparatorStyle" TargetType="{x:Type telerik:GridViewHeaderCell}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <Rectangle VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Fill="White" Height="45"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="BorderThickness" Value="0 0 0 0"/>
    </Style>
    
    <Style  x:Key="RadGridViewHeaderCellStyle" TargetType="{x:Type telerik:GridViewHeaderCell}">
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="HorizontalAlignment" Value="Left"></Setter>
        <Setter Property="VerticalAlignment" Value="Center"></Setter>
        <Setter Property="VerticalContentAlignment" Value="Center"></Setter>
        <Setter Property="BorderThickness" Value="0 0 0 0"/>
        <Setter Property="IsHitTestVisible" Value="False"/>
    </Style>

    <Style x:Key="RadGridViewColumnHeaderStyle" TargetType="{x:Type telerik:GridViewHeaderRow}">
        <Setter Property="Background" Value="{StaticResource Zentech_DarkGray}"/>
        <Setter Property="Foreground" Value="White"/>
        <Setter Property="TextElement.FontFamily" Value="{StaticResource PrimaryFont}"/>
        <Setter Property="TextElement.FontSize" Value="16pt"/>
        <Setter Property="HorizontalAlignment" Value="Left"/>
        <Setter Property="Height" Value="55"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="BorderThickness" Value="0 0 0 0"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="Margin" Value="0"/>
    </Style>

    <Style x:Key="RadGridViewRow_Standard" TargetType="{x:Type telerik:GridViewRow}" >
        <Setter Property="Background" Value="White"/>
        <Setter Property="Foreground" Value="{StaticResource Zentech_DarkGray}"/>
        <Setter Property="TextElement.FontFamily" Value="{StaticResource PrimaryFont}"/>
        <Setter Property="TextElement.FontSize" Value="16pt"/>
        <Setter Property="Height" Value="65"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <!--<Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type telerik:GridViewRow}">
                    <Border x:Name="DGR_Border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" 
                            Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
                        <SelectiveScrollingGrid>
                            <SelectiveScrollingGrid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                            </SelectiveScrollingGrid.ColumnDefinitions>
                            <SelectiveScrollingGrid.RowDefinitions>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                            </SelectiveScrollingGrid.RowDefinitions>
                            <DataGridCellsPresenter Grid.Column="1" ItemsPanel="{TemplateBinding ItemsPanel}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                            
                            <ContentPresenter Grid.Column="1" Content="{TemplateBinding Content}"/>
                            <Path Grid.Row="2" Grid.ColumnSpan="2"
                                      Data="M0,0.5 L1,0.5"
                                      Stretch="Fill" Stroke="{StaticResource Zentech_DarkGray}" StrokeThickness="1"
                                      StrokeDashArray="1.0 4.0"/>
                        </SelectiveScrollingGrid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>-->
    </Style>

 

Dinko
Telerik team
 answered on 06 Sep 2021
1 answer
14 views

Hello,

I find some problem when displaying lot of datapoints. What I try to achieve is define a constant width for each series and allow scrolling in horizontal axis. We try it but looks as horizontal scrollbar only is activated if zoom is sets. We want to keep bar series at fixed size and scroll it. 

On the attached images you can see how it looks now our charts. Our desired behaviours it´s to get this problem solved  for charts with categories but same issue it´s happens without categories. 

The behaviour we want to achieve is like we have a infinite canvas a just move. (Look desired.jpgto find a sketch)

 

Is there any option to configure it properly?

 

Thanks!

Martin Ivanov
Telerik team
 answered on 03 Sep 2021
1 answer
11 views
Is it possible to use the Telerik Autocomplete controls but have the data come from a cloud API call?
Dinko
Telerik team
 answered on 03 Sep 2021
1 answer
12 views

I need to remove all Telerik styling. I've downloaded source code and replaced all templates and styles but the orange color persists. 

Inside the RadAutoCompleteBox I see a RadListBox named PART_ListBox which has a DropDownItemTemplate. I can't figure out how to utilize this. Here's an example:

<Border Background="White" BorderBrush="White">
   <TextBlock Background="White" Foreground="Black" Text="{Binding}" />
   <Border.Resources>
      <SolidColorBrush x:Key="ControlOuterBorder_Highlighted" Color="LightGray" />
      <SolidColorBrush x:Key="ControlInnerBorder_Highlighted" Color="LightGray" />
      <SolidColorBrush x:Key="ControlBackground_Highlighted" Color="#F6F6F6" />
      <SolidColorBrush x:Key="ControlSubItem_OuterBorder_Selected" Color="#F6F6F6" />
      <SolidColorBrush x:Key="ControlSubItem_InnerBorder_Selected" Color="#F6F6F6" />
      <SolidColorBrush x:Key="ControlSubItem_Background_Selected" Color="#F6F6F6" />
      <SolidColorBrush x:Key="ControlOuterBorder_Focused" Color="#F6F6F6" />
   </Border.Resources>
</Border>

Issues:

1. TextBlock still has an orange border on hover. I tried adding all the resources I could find in the Telerik source code to hopefully override this. No luck.

2. The text displays the class name. The {Binding} is calling ToString() on the class. I need to display the DisplayMemberPath. I can't do {Binding Name} because I have dozens of classes that could go in here.

Dinko
Telerik team
 answered on 03 Sep 2021
1 answer
21 views

Hello,

i had a custom user control which i use in a GridView Column. The foreground should change by a binded value and a IValueConverter. The "Bad" state is red and the normal state is the default theme color.

The result should look like this (But it does only with a dirty hack -> use 2 idendical textblock and hide one or the other):

BUT i dont know how to get the default foreground (yellow unselected and white selected)

I tried:

  • return null in the IValueConverter -> No Color/Brush at all
  • Use a Multibinding and return the given second Binding: <Binding Source="{x:Static telerik:CrystalPalette.Palette}" Path="MarkerColor"/> -> Select state is not respected
  • Use a Multibinding to a "Helper" Element and return the value <Binding ElementName="ColorHelper" Path="Foreground"/>
    <TextBlock Name="ColorHelper" Foreground="{telerik:CrystalResource ResourceKey={x:Static telerik:CrystalResourceKey.MarkerBrush}}"> </TextBlock> -> Select state is not respected
Vladimir Stoyanov
Telerik team
 answered on 02 Sep 2021
1 answer
13 views

Dear sir,

RadPane gives as a default ContextMenu while pressing on the header .

 The Context menu contains the option of Hide.

Our customers can't make this RasPane visibly again, therefore for them it's act like  delete.

how can we change the Text inside this default  ContextMenu from Hide to Delete?

thank you

yafit

Stenly
Telerik team
 answered on 01 Sep 2021
Narrow your results
Selected tags
Tags
+? more
Top users last month
Matthias
Top achievements
Rank 5
Bronze
Bronze
Iron
Psyduck
Top achievements
Rank 4
Bronze
Bronze
Iron
Liu
Top achievements
Rank 1
Iron
Alex
Top achievements
Rank 1
Veteran
Iron
Iron
George C.
Top achievements
Rank 2
Iron
Veteran
Top users last month
Matthias
Top achievements
Rank 5
Bronze
Bronze
Iron
Psyduck
Top achievements
Rank 4
Bronze
Bronze
Iron
Liu
Top achievements
Rank 1
Iron
Alex
Top achievements
Rank 1
Veteran
Iron
Iron
George C.
Top achievements
Rank 2
Iron
Veteran