Telerik Forums
UI for WPF Forum
1 answer
15 views

I'm using a RadGrid / GridView and the performance is horrible. 

I'm not doing anything fancy. I have 15 columns and about 2000 rows 

In HTML, this is piece of cake, blazing fast and 200hz when scrolling. 

in WPF this just sucks at 5 fps and a very laggy experience.

I'm reading through the optimization docs and there are somewhat 50+ nobs to turn in the hope that it makes a difference. 

 

My humble request is therefore : Some Telerik Application Analyzer that scans through the program and finds all the problematic settings or constructions that hurt performance. 

I guess it should be pretty simple to look at container element properties and instance properties of the RadGrid and tell the user which ones are hurting the performance or disabling scroll virtualization... coz i have no idea. 

PS. One of the performance tips are completely impossible to correct: 

  • Placing RadGridView in panels/controls which measure it with infinity disables the UI virtualization mechanism of the control and can greatly impact performance when dealing with large amounts of data. Examples of such panels include ScrollViewerStackPanel and Grid with a definition with Width/Height set to Auto.

MANY UI-elements use Grid in their internal workings: 

MainWindow - uses a Grid with height/width = auto
AdornerDecorator - uses a Grid with height/width = auto
Rootgrid - uses a Grid with height/width = auto
TabControl - uses a Grid with height/width = auto
TabItem - uses a Grid with height/width = auto
Border (Contentpresenter) - uses a Grid with height/width = auto
RadBusyIndicator - uses a Grid with height/width = auto

So how the heck am i supposed to correct all those problems without completely going insane and create a stinking pile of code ? 

Dinko
Telerik team
 answered on 14 Sep 2021
0 answers
8 views

I want to draw a custom MajorLinesVisibility XY. 

MajorLinesVisibility Not using XY, instead, when CategoricalAxis' PlotMode is BetweenTicks,

I want to draw vertical lines between items.
Please refer to the referenced image.

 

<telerik:RadCartesianChart x:Name="chart1" Palette="Flower" Margin="10">
            <telerik:RadCartesianChart.HorizontalAxis>
                <!--PlotMode="BetweenTicks"-->
                <telerik:CategoricalAxis  x:Name="catAxis" PlotMode="BetweenTicks"  />
            </telerik:RadCartesianChart.HorizontalAxis>
            <telerik:RadCartesianChart.VerticalAxis>
                <telerik:LinearAxis x:Name="verticalAxis" />
            </telerik:RadCartesianChart.VerticalAxis>

           <telerik:RadCartesianChart.Grid>
                <telerik:CartesianChartGrid MajorLinesVisibility="XY" />
            </telerik:RadCartesianChart.Grid>
            <telerik:RadCartesianChart.Annotations>
                <telerik:CartesianGridLineAnnotation Axis="{Binding ElementName=catAxis}"
                   Value="B"   Stroke="Red"   StrokeThickness="5"       />
            </telerik:RadCartesianChart.Annotations>

yoochul
Top achievements
Rank 1
 updated question on 14 Sep 2021
1 answer
18 views

No video is shown when the camera starts and calling the TakeSnapshot method results in an exception in PresentationCore.CriticalFromVisual, with the message "parameter v cannot be null'.  

I've provided a simple test app that reproduces the problem. Platform is Windows 10, and the app is a .NET 5.0 WPF app using the latest Telerik UI for WPF nuget package. I have tried AnyCPU, x64 and x86 and the behavior is the same for all configurations, both release and debug. 

I have tested on a desktop machine with a Logitech 910 webcam and on a Surface Pro 3 using the internal camera. The identical code works fine on WPF .NET Framework 4.7.2 on both devices.

Project file is attached. 

Here is the window xaml:

 

<Window x:Class="cameratest.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:cameratest"
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
        mc:Ignorable="d"
        Title="MainWindow"
        Height="450"
        Width="800">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Button Width="80"
                Margin="4"
                HorizontalAlignment="Left"
                Click="OnSnapClick">Snap</Button>
        <telerik:RadWebCam Grid.Row="1"
                           x:Name="radWebCam" />
    </Grid>
</Window>


And the code behind:


using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Windows;
using System.Windows.Media.Imaging;
using Telerik.Windows.Controls;
using Telerik.Windows.MediaFoundation;

namespace cameratest
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            radWebCam.SnapshotTaken += RadWebCamOnSnapshotTaken;
            radWebCam.CameraError += RadWebCamOnCameraError;
        }

        private void RadWebCamOnCameraError(object sender, CameraErrorEventArgs e)
        {
            Debug.WriteLine(e.Error.Message);
        }

        private void RadWebCamOnSnapshotTaken(object sender, SnapshotTakenEventArgs e)
        {
            BitmapSource snapshot = e.Snapshot;
        }

        private void OnSnapClick(object sender, RoutedEventArgs e)
        {
            radWebCam.TakeSnapshot();
        }
    }
}

 

Modifying the app to disable auto start and initialize and state the camera manually results in the same problem.

 

 

Stenly
Telerik team
 answered on 13 Sep 2021
1 answer
8 views

I'm trying to use the VirtualGrid to show a collection of read-only  "record" objects in a report.  The problem is that each "record" is just a List<object> whose count and types are not know until runtime.  The column titles are stored separately in a different list of field descriptors.
 

I tried the CellValueNeeded approach (i.e. without using any sort of  DataSource, custom or otherwise), and while my data showed up just fine in the grid, I had no titles on the columns.  There doesn't seem to be any way to set the titles with this approach that I can see.  There is no corresponding ColumnTitleNeeded event, no SetColumnTitle function and no collection of columns I can access.  At least not that I can see  

 So how do I set the column titles in code behind?

(I should add that I also tried the Custom DataSource approach I looked at your VirtualGrid_WPF example in the SDK, but that seems to rely on the fact that each object representing a record ("Club" in the example) has property names and types that areknown at build time.    I could not make it work at all.   )

Joe
Top achievements
Rank 1
Iron
Veteran
Iron
 answered on 12 Sep 2021
1 answer
9 views

Hello, I can't find how to remove the border around the rows in my radgridview as shown in the screen shot

The first row is bordered in gray and the row which is moused over is bordered in orange

Here's the code for the radgridview with a column and the code for my row style :


<Grid Grid.Row="2" Grid.Column="1" Background="White" >
                <!-- Calibrators TAB -->
                <Grid x:Name="TabCalibrators" Visibility="Visible">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="775px"></RowDefinition>
                    </Grid.RowDefinitions>
                    <!--<Rectangle Width="500px" Height="2" Fill="White" HorizontalAlignment="Center" VerticalAlignment="Top"/>-->
                    <Border x:Name="BDRoundedCalibrators" Background="{StaticResource Zentech_DarkGray}" BorderThickness="0" BorderBrush="{x:Null}" CornerRadius="0,0,12,0"/>
                    <Line X1="0" Y1="0" Stroke="White" StrokeThickness="2" X2="1735" Y2="0" Grid.Row="0"/>
                    <telerik:RadGridView x:Name="GridCalibrators"
                            BorderBrush="Transparent"
                            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"
                            IsFilteringAllowed="False"
                            ReorderColumnsMode="None"
                            IsManipulationEnabled="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"
                                                        HeaderTextAlignment="Center"
                                                        CellStyle="{StaticResource ViewCellStyle}">
                                <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 RadGridViewColumnSeparatorSmallStyle}" />

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

 


    <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="Stretch"/>
        <Setter Property="MouseOverBackground" Value="Transparent"/>
        <Setter Property="SelectedBackground" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="{StaticResource Zentech_DarkGray}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="IsSelected" Value="False"/>
        <Setter Property="IsManipulationEnabled" Value="False"/>
    </Style>

Stenly
Telerik team
 answered on 10 Sep 2021
1 answer
19 views

Hello, I can't find how to remove the border around the header cells in my radgridview as shown in the screen shot

Here's the code for the radgridview with a column and the code for my styles :


<Grid Grid.Row="2" Grid.Column="1" Background="White" >
                <!-- Calibrators TAB -->
                <Grid x:Name="TabCalibrators" Visibility="Visible">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="775px"></RowDefinition>
                    </Grid.RowDefinitions>
                    <!--<Rectangle Width="500px" Height="2" Fill="White" HorizontalAlignment="Center" VerticalAlignment="Top"/>-->
                    <Border x:Name="BDRoundedCalibrators" Background="{StaticResource Zentech_DarkGray}" BorderThickness="0" BorderBrush="{x:Null}" CornerRadius="0,0,12,0"/>
                    <Line X1="0" Y1="0" Stroke="White" StrokeThickness="2" X2="1735" Y2="0" Grid.Row="0"/>
                    <telerik:RadGridView x:Name="GridCalibrators"
                            BorderBrush="Transparent"
                            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"
                            IsFilteringAllowed="False"
                            ReorderColumnsMode="None"                                         
                            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"
                                                        HeaderTextAlignment="Center">
                                <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 RadGridViewColumnSeparatorSmallStyle}" />

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

 


    <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"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <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 0 0 0"/>
        <Setter Property="Padding" Value="0"/>
    </Style>


Stenly
Telerik team
 answered on 10 Sep 2021
1 answer
15 views
Hello Team,
 
We are using Telerik WPF control version 2014Q1 and finding one issue in printing the pdf file using RadPdfViewer which contains embedded weblink image that it is trying to load when we click on the Print PDF icon and we are actually calling the Telerik PrintPdfDocumentCommand and seems the issue is within the Telerik assembly Telerik.Windows.Documents.Commands. You can check the screenshot for the error.
You can download the similar file in the given link to regenerate the error: https://bsaonline.com/SiteSearch/SiteSearchDetails?SearchFocus=All%20Records&SearchCategory=Address&SearchText=4936%20S%20176TH%20AVE&uid=1665&PageIndex=1&ReferenceKey=019-004-100-15&ReferenceType=0&SortBy=&SearchOrigin=0&RecordKeyDisplayString=019-004-100-15&RecordKey=019-004-100-15&RecordKeyType=0
 
Also, we have attached a zip file that contains a PDF file for testing to regenerate the issue.
 
Can you please look into it and revert back with the affirmative solution.

#WPF
Martin
Telerik team
 answered on 10 Sep 2021
1 answer
17 views

How to display Radribbon or Toolbar in Raddocking undocked tool window.

i want to display toolbar for undocked wibdow and in case of docked window display same toolbar in Mainwindow.

 

how to implement this?

Stenly
Telerik team
 answered on 09 Sep 2021
1 answer
4 views

I have two real-time data sets I want to display, with a maximum of about 200,000 data point per series.  Filling in this series up to the first 200,000 points works fine, but my UI performance drops considerably once I start trying to shift out the oldest points to make room for the new ones.  My sample rate is 10,000 samples per second, and they're coming in about 32 samples at a time.

I've implemented the approach here in the forum post below the update the DataPoint X and Y values as my new data comes in rather than removing and adding data points, but this still does not perform well enough - my UI locks up for several seconds before any update is shown once I reach the maximum size of my series. 

https://www.telerik.com/forums/radobservablecollection-o(1)-item-removal#3808663

I also tried implementing the AsyncData example, but it has the same issue because the series updates only happen one data point at a time, so the entire list gets shifted for every point that I add, rather than shifting the list in larger increments.

For performance, I would like to change out the underlying storage of the series data points with a queue so I can have a near constant time performance shifting out the old data and shifting in the new data, without needing to go through the entire series every time.  However, I cannot inherit from any of the ChartSeries base classes because some of the abstract properties use internal types.

Is there any other solution for improving the performance with around 200,000 data points in real-time?

 

Thanks,

Brandon

Dinko
Telerik team
 answered on 08 Sep 2021
2 answers
14 views

Hi

Can I add hyperlink to desktopalert dynamically?

thank you

m
Top achievements
Rank 1
Iron
 answered on 08 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