Telerik Forums
UI for WPF Forum
1 answer
223 views

Hi,

After 9h 15min of trying to change the color of a f**king selected Tab of a Radpane I finally give up an post this thread.

I have created a copy of RadPane Control and Placed it in a style. Changed and added Values. Commented things out. And allways the same result.

Here is my code:

<Style TargetType="telerik:RadPane" BasedOn="{StaticResource RadPaneStyle}">
                <Setter Property="Background" Value="#121212"/>
                <Setter Property="Foreground" Value="#808080"/>
                <Setter Property="Template">
                    <Setter.Value>
                    <ControlTemplate>
                        <Grid x:Name="wrapper" Margin="0,0,0,-2" Background="Purple">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <DoubleAnimation To="0.2" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="HeaderElement"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="MouseOver">
                                        <Storyboard>
                                           
                                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="MouseOverVisual"/>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="PinnedVisual">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="#202020"/>
                                                   
                                            </ObjectAnimationUsingKeyFrames>
                                            
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Selected">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)"  Storyboard.TargetName="SelectedVisual"/>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="HeaderElement">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="#202020"/>
                                                  
                                                </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="PinnedStates">
                                    <VisualState x:Name="Unpinned">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PinnedVisual"/>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Margin" Storyboard.TargetName="wrapper">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Thickness>1</Thickness>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Margin" Storyboard.TargetName="HeaderElement">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Thickness>0</Thickness>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="MouseOverVisual">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Collapsed</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Pinned"/>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Border x:Name="PinnedVisual" BorderBrush="Red" Background="Red" BorderThickness="0,0,0,4" Grid.ColumnSpan="2" Opacity="0"/>
                            <Border x:Name="MouseOverVisual"  Background="Red" Grid.ColumnSpan="2" Opacity="0"/>
                            <Border x:Name="SelectedVisual" BorderBrush="Red" BorderThickness="1,0,1,1" Background="Red" Margin="0,-1,0,0" Opacity="0"/>
                            <Primitives:TabItemContentPresenter x:Name="HeaderElement" Background="Red" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" MinHeight="16" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}">
                                <Primitives:TabItemContentPresenter.Style>
                                    <Style TargetType="{x:Type Primitives:TabItemContentPresenter}">
                                            <Setter Property="Background" Value="Blue"/>
                                            <Setter Property="Template">
                                            <Setter.Value>
                                                <ControlTemplate TargetType="{x:Type Primitives:TabItemContentPresenter}">
                                                    <Border BorderBrush="{TemplateBinding BorderBrush}" Background="OrangeRed" BorderThickness="{TemplateBinding BorderThickness}" >
                                                            <ContentPresenter  ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                                                    </Border>
                                                </ControlTemplate>
                                            </Setter.Value>
                                        </Setter>
                                        <Setter Property="IsTabStop" Value="False"/>
                                    </Style>
                                </Primitives:TabItemContentPresenter.Style>
                            </Primitives:TabItemContentPresenter>
                        </Grid>
                    </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

 

Also tried to get some results by creating copy of all other raddocking components.

Why can't there be a simple TabItemHeaderTemplate which can easily be styled?

Btw. I don't want to use any predefined theme.

Regard


Vicky
Telerik team
 answered on 28 Jun 2019
4 answers
444 views
Hi,
I have a RadTabControl with several tab items, and a RadGridView inside each TabItem, with its ItemsSource binded to a specific collection of data.
Of course the data of those RadGridViews is loaded only when the containing tabitem is selected at least once, and the gridview is shown at least once.

My problem is that I need to export the data of all those RadGridViews (using Export() method), whether they have been selected by the user or not.
By now I may export data only of those grid that have been shown at least once, the others don't contain any data.

So the question is:
Is there a way to force a RadGridView to load its data without showing it, (in my case without manually selecting the RadTabItem that contains the grid)?

Thank you very much for your kind attention

Enrico
Chris
Top achievements
Rank 1
 answered on 28 Jun 2019
5 answers
377 views

Currently when you highlight a row in the child GridView, the ParentRow becomes highlighted. It would be really nice to have an option so that the ParentRow would be selected when a row in the child GridView is selected. This should work recursively selecting the ParentRow all the way up the hierarchy.

I've written a workaround, but it isn't pretty.

Please add this functionality. :)

 

My case involves a three tier hierarchical GridView. If I select a row in a third tier GridView, then I want its ParentRow to become selected on the second tier and the second tier's ParentRow to become selected on the first tier. Hopefully that makes sense.

Usman
Top achievements
Rank 1
 answered on 28 Jun 2019
1 answer
411 views

Hello,

Is there a way to only display the TrackBall Info box when the right mouse button is clicked? We have a lot of info on our chart and sometimes the info box obscures the graph underneath.

Thanks.

Martin Ivanov
Telerik team
 answered on 28 Jun 2019
3 answers
145 views
Hi,

 

I tried to open a document using the OpenDocumentCommand but it's not working.

Could you provide me some information how to achieve this?

Btw: SaveCommand opens the SaveFileDialog as expected.

 

best regards

Dietmar

 
<Window
    x:Class="telerikrtbtest.MainWindow"
    xmlns:local="clr-namespace:telerikrtbtest"
    Title="MainWindow"
    Width="525"
    Height="350"
    mc:Ignorable="d">
    <Grid>
        <Grid.Resources />
 
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
 
        <telerik:RadRibbonButton
            x:Name="OpenDocumentButton"
            Margin="0,2,2,2"
            telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding OpenDocumentCommand}"
            Content="open"
            DataContext="{Binding Commands, ElementName=richTextBoxAdv}" />
 
        <telerik:RadRichTextBox x:Name="radRichTextBox" Grid.Row="1" />
 
 
    </Grid>
</Window>
Dietmar
Top achievements
Rank 1
 answered on 27 Jun 2019
3 answers
204 views

I'm looking to achieve a Tile "Grid"-like behavior, with Tiles of varying sizes being placed with optional space between them within in a fixed area. The tiles would be resizable between the provided sizes (Single, Double, Quad) but also a 1x2 orientation (Tall) and the space between them would always been in increments of the fixed TilePlaceHolderSide value. See the behavior of the Windows 10 Start Menu Tiles for the closest easily-accessible example.

I am well aware that I'm going to have to do some customization, particularly in layout/measurement, but I'm just wondering:

  • Which would be a better starting point: TileList or TileView?
  • Would I have to modify the source directly, or would simply creating a custom control that inherits from TileList or TileView be enough?
  • Has anyone on these forums met a similar requirement and have any advice?
Ryan
Top achievements
Rank 1
 answered on 27 Jun 2019
1 answer
2.6K+ views
How can I enable wrap text in telerik label?
Dimitar Dinev
Telerik team
 answered on 27 Jun 2019
0 answers
94 views

Hello Developers,

I have simple scenario. Three charts with Zoom and Pan behavior and Track Ball behavior. When i zoom(or pan) in one chart then zoom(or pan) is bind to another charts. 

I have to display datas for one day. I am using DateTimeCategoricalAxis and populate collection with data each minute. That means i have 1440 categories. 

I display 3 series (bar, line, point). Everything works, but if i zoom in that scenario trackball info is not updated well. 

Trackball info is still on same place and is blank. 

You can see it in attached file.

<Window x:Class="Chart.MainWindow"
        xmlns:local="clr-namespace:Chart"
        xmlns:chartView="clr-namespace:Telerik.Windows.Controls.ChartView;assembly=Telerik.Windows.Controls.Chart"
        mc:Ignorable="d"
        Title="MainWindow">
    <Grid>
        <Grid.Resources>
            <Style x:Key="MonitorChartStyle" TargetType="telerik:RadCartesianChart">
                <Setter Property="Margin" Value="4" />
                <Setter Property="TrackBallLineStyle" Value="{x:Null}" />
            </Style>
            <DataTemplate x:Key="TrackBallInfoTemplateOnlineQuality">
                <StackPanel Orientation="Horizontal">
                    <Rectangle Fill="DodgerBlue"
                               Width="8"
                               Height="8"
                               StrokeThickness="1"
                               Stroke="White"
                               VerticalAlignment="Center"
                               Margin="4,0,4,0" />
                    <TextBlock
                        Text="Tonnage: " />
                    <TextBlock Text="{Binding DataPoint.Value, StringFormat={}{0:0.##}}" />
                </StackPanel>
            </DataTemplate>
        </Grid.Resources>
 
        <StackPanel Orientation="Vertical">
            <telerik:RadCartesianChart HorizontalAlignment="Stretch"
                                       Style="{DynamicResource MonitorChartStyle}"
                                       Zoom="{Binding Path=Zoom, Mode=TwoWay}"
                                       PanOffset="{Binding Path=PanOffset, Mode=TwoWay}"
                                       MinHeight="200" Height="200">
                <telerik:RadCartesianChart.Grid>
                    <telerik:CartesianChartGrid MajorLinesVisibility="XY" />
                </telerik:RadCartesianChart.Grid>
                <telerik:RadCartesianChart.HorizontalAxis>
                    <telerik:DateTimeCategoricalAxis
                        x:Name="HorizontalAxis"
                        SmartLabelsMode="SmartStep"
                        MajorTickInterval="10"
                        MajorTickStyle="{x:Null}" />
                </telerik:RadCartesianChart.HorizontalAxis>
                <telerik:RadCartesianChart.VerticalAxis>
                    <telerik:LinearAxis x:Name="VerticalAxis"
                                        SmartLabelsMode="SmartStepAndRange"
                                        Minimum="0"
                                        Maximum="100">
                        <telerik:LinearAxis.LabelStyle>
                            <Style TargetType="TextBlock">
                                <Setter Property="Width" Value="50" />
                                <Setter Property="TextAlignment" Value="Right" />
                            </Style>
                        </telerik:LinearAxis.LabelStyle>
                    </telerik:LinearAxis>
                </telerik:RadCartesianChart.VerticalAxis>
                <telerik:BarSeries ItemsSource="{Binding DestinationDataSeries}"
                                   CategoryBinding="Category"
                                   ValueBinding="Value"
                                   TrackBallInfoTemplate="{StaticResource TrackBallInfoTemplateOnlineQuality}">
                    <!--TrackBallInfoTemplate="{StaticResource TrackBallInfoTemplateOnlineQuality}"-->
                    <telerik:BarSeries.VerticalAxis>
                        <telerik:LinearAxis SmartLabelsMode="SmartStepAndRange"
                                            HorizontalLocation="Right"
                                            Minimum="0"
                                            Maximum="100">
                            <telerik:LinearAxis.LabelStyle>
                                <Style TargetType="TextBlock">
                                    <Setter Property="Width" Value="50" />
                                    <Setter Property="TextAlignment" Value="Left" />
                                </Style>
                            </telerik:LinearAxis.LabelStyle>
                        </telerik:LinearAxis>
                    </telerik:BarSeries.VerticalAxis>
                    <telerik:BarSeries.DefaultVisualStyle>
                        <Style TargetType="Border">
                            <Setter Property="Background" Value="DodgerBlue" />
                        </Style>
                    </telerik:BarSeries.DefaultVisualStyle>
                </telerik:BarSeries>
                <chartView:LineSeries ItemsSource="{Binding SourceDataSeries}"
                                      CategoryBinding="Category"
                                      ValueBinding="Value"
                                      Stroke="Red"
                                      TrackBallInfoTemplate="{StaticResource TrackBallInfoTemplateOnlineQuality}" />
                <telerik:PointSeries ItemsSource="{Binding OnlineDataSeries}"
                                     CategoryBinding="Category"
                                     ValueBinding="Value"
                                     TrackBallInfoTemplate="{StaticResource TrackBallInfoTemplateOnlineQuality}">
                    <telerik:PointSeries.PointTemplate>
                        <DataTemplate>
                            <Path Margin="4"
                                  Stroke="Orange"
                                  StrokeThickness="1"
                                  StrokeStartLineCap="Square"
                                  StrokeEndLineCap="Square"
                                  Stretch="Uniform"
                                  VerticalAlignment="Center"
                                  HorizontalAlignment="Center">
                                <Path.Data>
                                    <PathGeometry>
                                        <PathGeometry.Figures>
                                            <PathFigure StartPoint="0,0">
                                                <LineSegment Point="4,4" />
                                            </PathFigure>
                                            <PathFigure StartPoint="0,4">
                                                <LineSegment Point="4,0" />
                                            </PathFigure>
                                        </PathGeometry.Figures>
                                    </PathGeometry>
                                </Path.Data>
                            </Path>
                        </DataTemplate>
                    </telerik:PointSeries.PointTemplate>
                </telerik:PointSeries>
                <telerik:RadCartesianChart.Behaviors>
                    <telerik:ChartTrackBallBehavior ShowIntersectionPoints="False"
                                                    ShowTrackInfo="True" />
                    <telerik:ChartPanAndZoomBehavior ZoomMode="Horizontal" DragMode="Pan" PanMode="Horizontal" />
                </telerik:RadCartesianChart.Behaviors>
            </telerik:RadCartesianChart>
            <telerik:RadCartesianChart HorizontalAlignment="Stretch"
                                       Style="{DynamicResource MonitorChartStyle}"
                                       Zoom="{Binding Path=Zoom, Mode=TwoWay}"
                                       PanOffset="{Binding Path=PanOffset, Mode=TwoWay}"
                                       MinHeight="200" Height="200">
                <telerik:RadCartesianChart.Grid>
                    <telerik:CartesianChartGrid MajorLinesVisibility="XY" />
                </telerik:RadCartesianChart.Grid>
                <telerik:RadCartesianChart.HorizontalAxis>
                    <telerik:DateTimeCategoricalAxis
                        x:Name="HorizontalAxis2"
                        SmartLabelsMode="SmartStep"
                        MajorTickInterval="10"
                        MajorTickStyle="{x:Null}" />
                </telerik:RadCartesianChart.HorizontalAxis>
                <telerik:RadCartesianChart.VerticalAxis>
                    <telerik:LinearAxis x:Name="VerticalAxis2"
                                        SmartLabelsMode="SmartStepAndRange"
                                        Minimum="0"
                                        Maximum="100">
                        <telerik:LinearAxis.LabelStyle>
                            <Style TargetType="TextBlock">
                                <Setter Property="Width" Value="50" />
                                <Setter Property="TextAlignment" Value="Right" />
                            </Style>
                        </telerik:LinearAxis.LabelStyle>
                    </telerik:LinearAxis>
                </telerik:RadCartesianChart.VerticalAxis>
                <telerik:BarSeries ItemsSource="{Binding DestinationDataSeries}"
                                   CategoryBinding="Category"
                                   ValueBinding="Value"
                                   TrackBallInfoTemplate="{StaticResource TrackBallInfoTemplateOnlineQuality}">
                    <!--TrackBallInfoTemplate="{StaticResource TrackBallInfoTemplateOnlineQuality}"-->
                    <telerik:BarSeries.VerticalAxis>
                        <telerik:LinearAxis SmartLabelsMode="SmartStepAndRange"
                                            HorizontalLocation="Right"
                                            Minimum="0"
                                            Maximum="100">
                            <telerik:LinearAxis.LabelStyle>
                                <Style TargetType="TextBlock">
                                    <Setter Property="Width" Value="50" />
                                    <Setter Property="TextAlignment" Value="Left" />
                                </Style>
                            </telerik:LinearAxis.LabelStyle>
                        </telerik:LinearAxis>
                    </telerik:BarSeries.VerticalAxis>
                    <telerik:BarSeries.DefaultVisualStyle>
                        <Style TargetType="Border">
                            <Setter Property="Background" Value="DodgerBlue" />
                        </Style>
                    </telerik:BarSeries.DefaultVisualStyle>
                </telerik:BarSeries>
                <chartView:LineSeries ItemsSource="{Binding SourceDataSeries}"
                                      CategoryBinding="Category"
                                      ValueBinding="Value"
                                      Stroke="Red"
                                      TrackBallInfoTemplate="{StaticResource TrackBallInfoTemplateOnlineQuality}" />
                <telerik:PointSeries ItemsSource="{Binding OnlineDataSeries}"
                                     CategoryBinding="Category"
                                     ValueBinding="Value"
                                     TrackBallInfoTemplate="{StaticResource TrackBallInfoTemplateOnlineQuality}">
                    <telerik:PointSeries.PointTemplate>
                        <DataTemplate>
                            <Path Margin="4"
                                  Stroke="Orange"
                                  StrokeThickness="1"
                                  StrokeStartLineCap="Square"
                                  StrokeEndLineCap="Square"
                                  Stretch="Uniform"
                                  VerticalAlignment="Center"
                                  HorizontalAlignment="Center">
                                <Path.Data>
                                    <PathGeometry>
                                        <PathGeometry.Figures>
                                            <PathFigure StartPoint="0,0">
                                                <LineSegment Point="4,4" />
                                            </PathFigure>
                                            <PathFigure StartPoint="0,4">
                                                <LineSegment Point="4,0" />
                                            </PathFigure>
                                        </PathGeometry.Figures>
                                    </PathGeometry>
                                </Path.Data>
                            </Path>
                        </DataTemplate>
                    </telerik:PointSeries.PointTemplate>
                </telerik:PointSeries>
                <telerik:RadCartesianChart.Behaviors>
                    <telerik:ChartTrackBallBehavior ShowIntersectionPoints="False"
                                                    ShowTrackInfo="True" />
                    <telerik:ChartPanAndZoomBehavior ZoomMode="Horizontal" DragMode="Pan" PanMode="Horizontal" />
                </telerik:RadCartesianChart.Behaviors>
            </telerik:RadCartesianChart>
            <telerik:RadCartesianChart HorizontalAlignment="Stretch"
                                       Style="{DynamicResource MonitorChartStyle}"
                                       Zoom="{Binding Path=Zoom, Mode=TwoWay}"
                                       PanOffset="{Binding Path=PanOffset, Mode=TwoWay}"
                                       MinHeight="200" Height="200">
                <telerik:RadCartesianChart.Grid>
                    <telerik:CartesianChartGrid MajorLinesVisibility="XY" />
                </telerik:RadCartesianChart.Grid>
                <telerik:RadCartesianChart.HorizontalAxis>
                    <telerik:DateTimeCategoricalAxis
                        x:Name="HorizontalAxis3"
                        SmartLabelsMode="SmartStep"
                        MajorTickInterval="10"
                        MajorTickStyle="{x:Null}" />
                </telerik:RadCartesianChart.HorizontalAxis>
                <telerik:RadCartesianChart.VerticalAxis>
                    <telerik:LinearAxis x:Name="VerticalAxis3"
                                        SmartLabelsMode="SmartStepAndRange"
                                        Minimum="0"
                                        Maximum="100">
                        <telerik:LinearAxis.LabelStyle>
                            <Style TargetType="TextBlock">
                                <Setter Property="Width" Value="50" />
                                <Setter Property="TextAlignment" Value="Right" />
                            </Style>
                        </telerik:LinearAxis.LabelStyle>
                    </telerik:LinearAxis>
                </telerik:RadCartesianChart.VerticalAxis>
                <telerik:BarSeries ItemsSource="{Binding DestinationDataSeries}"
                                   CategoryBinding="Category"
                                   ValueBinding="Value"
                                   TrackBallInfoTemplate="{StaticResource TrackBallInfoTemplateOnlineQuality}">
                    <!--TrackBallInfoTemplate="{StaticResource TrackBallInfoTemplateOnlineQuality}"-->
                    <telerik:BarSeries.VerticalAxis>
                        <telerik:LinearAxis SmartLabelsMode="SmartStepAndRange"
                                            HorizontalLocation="Right"
                                            Minimum="0"
                                            Maximum="100">
                            <telerik:LinearAxis.LabelStyle>
                                <Style TargetType="TextBlock">
                                    <Setter Property="Width" Value="50" />
                                    <Setter Property="TextAlignment" Value="Left" />
                                </Style>
                            </telerik:LinearAxis.LabelStyle>
                        </telerik:LinearAxis>
                    </telerik:BarSeries.VerticalAxis>
                    <telerik:BarSeries.DefaultVisualStyle>
                        <Style TargetType="Border">
                            <Setter Property="Background" Value="DodgerBlue" />
                        </Style>
                    </telerik:BarSeries.DefaultVisualStyle>
                </telerik:BarSeries>
                <chartView:LineSeries ItemsSource="{Binding SourceDataSeries}"
                                      CategoryBinding="Category"
                                      ValueBinding="Value"
                                      Stroke="Red"
                                      TrackBallInfoTemplate="{StaticResource TrackBallInfoTemplateOnlineQuality}" />
                <telerik:PointSeries ItemsSource="{Binding OnlineDataSeries}"
                                     CategoryBinding="Category"
                                     ValueBinding="Value"
                                     TrackBallInfoTemplate="{StaticResource TrackBallInfoTemplateOnlineQuality}">
                    <telerik:PointSeries.PointTemplate>
                        <DataTemplate>
                            <Path Margin="4"
                                  Stroke="Orange"
                                  StrokeThickness="1"
                                  StrokeStartLineCap="Square"
                                  StrokeEndLineCap="Square"
                                  Stretch="Uniform"
                                  VerticalAlignment="Center"
                                  HorizontalAlignment="Center">
                                <Path.Data>
                                    <PathGeometry>
                                        <PathGeometry.Figures>
                                            <PathFigure StartPoint="0,0">
                                                <LineSegment Point="4,4" />
                                            </PathFigure>
                                            <PathFigure StartPoint="0,4">
                                                <LineSegment Point="4,0" />
                                            </PathFigure>
                                        </PathGeometry.Figures>
                                    </PathGeometry>
                                </Path.Data>
                            </Path>
                        </DataTemplate>
                    </telerik:PointSeries.PointTemplate>
                </telerik:PointSeries>
                <telerik:RadCartesianChart.Behaviors>
                    <telerik:ChartTrackBallBehavior ShowIntersectionPoints="False"
                                                    ShowTrackInfo="True" />
                    <telerik:ChartPanAndZoomBehavior ZoomMode="Horizontal" DragMode="Pan" PanMode="Horizontal" />
                </telerik:RadCartesianChart.Behaviors>
            </telerik:RadCartesianChart>
        </StackPanel>
    </Grid>
</Window>

 

and code behind:

using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Windows;
using Telerik.Charting;
 
namespace Chart
{
    /// <summary>
    ///     Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window, INotifyPropertyChanged
    {
        private Point _pan;
        private Size _zoom;
 
        public MainWindow()
        {
            InitializeComponent();
 
            DestinationDataSeries = new ObservableCollection<CategoricalDataPoint>();
            SourceDataSeries = new ObservableCollection<CategoricalDataPoint>();
            OnlineDataSeries = new ObservableCollection<CategoricalDataPoint>();
 
            var rand = new Random();
 
            for (DateTime i = DateTime.Now; i < DateTime.Now.AddDays(1); i = i.AddMinutes(1))
            {
                DestinationDataSeries.Add(new CategoricalDataPoint
                {
                    Category = i,
                    Value = rand.NextDouble() * 100
                });
                SourceDataSeries.Add(new CategoricalDataPoint
                {
                    Category = i,
                    Value = rand.NextDouble() * 100
                });
                OnlineDataSeries.Add(new CategoricalDataPoint
                {
                    Category = i,
                    Value = rand.NextDouble() * 100
                });
            }
 
            DataContext = this;
        }
 
        public event PropertyChangedEventHandler PropertyChanged;
 
        protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }
 
        #region MainWindow
 
        public ObservableCollection<CategoricalDataPoint> DestinationDataSeries { get; }
 
        public ObservableCollection<CategoricalDataPoint> SourceDataSeries { get; }
 
        public ObservableCollection<CategoricalDataPoint> OnlineDataSeries { get; }
 
        public Size Zoom
        {
            get => _zoom;
            set
            {
                _zoom = value;
                OnPropertyChanged();
            }
        }
 
        public Point PanOffset
        {
            get => _pan;
            set
            {
                _pan = value;
                OnPropertyChanged();
            }
        }
 
        #endregion
    }
}

Thank you for your help and reply.

Best Regards Jan. 

Jan
Top achievements
Rank 1
 asked on 27 Jun 2019
2 answers
128 views

Within my dategrid itemsource I have some properties that basically act as IValueConverters to lookup a string in a dictonary by using and int.

 Public ReadOnly Property ReifenIdHintenBezeichnung As String
            Get
                If Fahrzeug.ReifenIdHinten.HasValue Then
                    Return _reifenDict(Fahrzeug.ReifenIdHinten.Value)
                Else
                    Return String.Empty
                End If
            End Get
        End Property

these columns are bound to a datatemplate that acts as cellTemplate for a combobox like this:

<DataTemplate><TextBlock Text="{Binding ReifenIdHintenBezeichnung }" /></DataTemplate>

(the whole idea to use a value converter with a dictonary was inspired by this https://feedback.telerik.com/wpf/1352336-slow-scrolling-when-a-gridviewcomboboxcolumn-is-bound-to-a-large-dataset) but as I need to create columns dynamically, I ended up with this property (and for the truely dynamic part properties with a parameter - but that's not the issue).

I noticed that the property is called everytime I scroll down one row for the following row. so one row is cached but not the row afterwards. 

My question is if there is a way to use virtualization in such a way that say 20 rows and 10 columns are prefetched (async at best) to increase performance.

If you got any other suggestions on how to improve scolling performance with Comboboxes, i'm happy to read them. I already applied most tips mentioned here:https://docs.telerik.com/devtools/wpf/controls/radgridview/performance/tips-tricks

 

thanks for your help!

Jan

 

Jan
Top achievements
Rank 1
 answered on 27 Jun 2019
3 answers
659 views

Hello,
I have a RadGridView and I am filling it with data and styling it in the ViewModel of my wpf app.
I have the following code:

FontSizeConverter myFontSizeConverter = new FontSizeConverter();
Style headerStyle = new Style(typeof(GridViewHeaderCell));
headerStyle.Setters.Add(new Setter(HeaderedContentControl.HorizontalContentAlignmentProperty, System.Windows.HorizontalAlignment.Left));
headerStyle.Setters.Add(new Setter(HeaderedContentControl.BackgroundProperty, (Brush)(new BrushConverter().ConvertFrom("#546E7A"))));
headerStyle.Setters.Add(new Setter(HeaderedContentControl.ForegroundProperty, (Brush)(new BrushConverter().ConvertFrom("#ffffff"))));
headerStyle.Setters.Add(new Setter(HeaderedContentControl.FontWeightProperty, FontWeights.Bold));
headerStyle.Setters.Add(new Setter(HeaderedContentControl.FontSizeProperty, (Double)myFontSizeConverter.ConvertFromString("12")));

 

var headerIsMouseOverTrigger = new Trigger();
headerIsMouseOverTrigger.Property = UIElement.IsMouseOverProperty;
headerIsMouseOverTrigger.Value = true;

var headerIsMouseOverStyle = new Style(typeof(GridViewHeaderCell));
headerIsMouseOverStyle.Setters.Add(new Setter(HeaderedContentControl.HorizontalContentAlignmentProperty, System.Windows.HorizontalAlignment.Left));
headerIsMouseOverStyle.Setters.Add(new Setter(HeaderedContentControl.BackgroundProperty, (Brush)(new BrushConverter().ConvertFrom("#546E7A"))));
headerIsMouseOverStyle.Setters.Add(new Setter(HeaderedContentControl.ForegroundProperty, (Brush)(new BrushConverter().ConvertFrom("#ffffff"))));
headerIsMouseOverStyle.Setters.Add(new Setter(HeaderedContentControl.FontWeightProperty, FontWeights.Bold));
headerIsMouseOverStyle.Setters.Add(new Setter(HeaderedContentControl.FontSizeProperty, (Double)myFontSizeConverter.ConvertFromString("12")));

headerIsMouseOverTrigger.Setters.Add(new Setter(GridViewHeaderCell.StyleProperty, headerIsMouseOverStyle));
headerStyle.Triggers.Add(headerIsMouseOverTrigger);

 

var name = new GridViewDataColumn()
{
DataMemberBinding = new Binding("Name"),
IsReadOnly = true,
IsFilterable = false,
IsResizable = false,
Width = 210.0D,
Header = base.GetText(2615),
HeaderCellStyle = headerStyle,
Tag = "NotSelected"
};

What I am trying to accomplish is not to change the background of the column header  when the mouse is over it. Can you tell me what I am doing wrong and how to make the desired effect? Thank you :)



Vladimir Stoyanov
Telerik team
 answered on 27 Jun 2019
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
ProgressBar
Sparkline
LayoutControl
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?