Telerik Forums
UI for WPF Forum
1 answer
9 views

I use RadRichTextBox (WPF) to edit HTML documents.

These contain images with annotations.

It works as expected (except for the context menu popping up when I mark an image) and I can position the images according to my needs.

See Before.png where the red arrow points to something in the image.

When I save the HTML and load it into the RadRichTextBox again the image positioning is totally gone. See After.png

Am I missing something or does the HtmlDataProvider simply not work as expected?

Dimitar
Telerik team
 answered on 08 Aug 2025
1 answer
6 views

Is this the best place to report bugs?

This is with 2024.4.1213.462.

To duplicate the issue:

  1. With VS 2022, create a WPF (.NET Framework) application,
  2. Delete MainWindow.xaml and MainWindow.xaml.cs
  3. Unzip the attached file, place MainWindow.xaml and MainWindow.xaml.cs from the zip where the old files were or use the pasted text below
  4. Build and run the application
  5. Put focus on a cell in a row in the grid and type a letter

Expect the following exception to be raised

NameValueType
$exception{"Object reference not set to an instance of an object."}System.NullReferenceException

at Telerik.Windows.Controls.DateTimePickerGridViewEditor.Telerik.Windows.Controls.GridView.IGridViewEditor.SetText(String text) in Telerik.Windows.Controls\DateTimePickerGridViewEditor.cs:line 56

 

In case the zip doesn't work:

MainWindow.xaml.cs:

namespace WpfApp14
{
    using System;
    using System.ComponentModel;
    using System.Windows;
    using System.Collections.ObjectModel;

    public sealed class GridValueViewModel : INotifyPropertyChanged
    {
        private string someValue = string.Empty;

        public GridValueViewModel(string someValue)
        {
            this.SomeValue = someValue;
        }

        public event PropertyChangedEventHandler PropertyChanged;

        public string SomeValue
        {
            get
            {
                return this.someValue;
            }

            set
            {
                value = value ?? string.Empty;
                if (this.SomeValue != value)
                {
                    this.someValue = value;
                    this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(this.SomeValue)));
                }
            }
        }

        public DateTime? DateValue
        {
            get
            {
                if (DateTime.TryParse(this.SomeValue, out var value))
                {
                    return value;
                }

                return null;
            }

            set
            {
                if (value == null)
                {
                    this.SomeValue = string.Empty;
                    return;
                }

                this.SomeValue = value.ToString();
            }
        }

        public ObservableCollection<string> SomeValueItems { get; } = new ObservableCollection<string>(
            new[]
            {
                "cat",
                "dog",
                "bird"
            });
        
    }

    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            this.InitializeComponent();
            this.DataContext = this;
        }

        public ObservableCollection<GridValueViewModel> Values { get; } = new ObservableCollection<GridValueViewModel>(
            new[]
            {
                new GridValueViewModel("cat"),
                new GridValueViewModel("dog"),
                new GridValueViewModel("bird")
            });
    }
}

 

MainWindow.xaml:

<Window x:Class="WpfApp14.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:telerik="http://schemas.telerik.com/2008/xaml/presentation"
        mc:Ignorable="d"
        Title="MainWindow" Height="450" Width="800">
    <telerik:RadGridView
        AutoGenerateColumns="False"
        ItemsSource="{Binding Values, Mode=OneWay}">
        <telerik:RadGridView.Columns>
            <telerik:GridViewDataColumn
                Header="Column 1">
                <telerik:GridViewDataColumn.CellTemplate>
                    <DataTemplate>
                        <Label
                            Content="{Binding SomeValue}" />
                    </DataTemplate>
                </telerik:GridViewDataColumn.CellTemplate>
                <telerik:GridViewDataColumn.CellEditTemplate>
                    <DataTemplate>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition
                                    Width="*" />
                            </Grid.ColumnDefinitions>
                            <TextBox
                                Grid.Column="0"
                                Text="{Binding SomeValue, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}"
                                Visibility="Collapsed" />
                            <telerik:RadComboBox
                                Grid.Column="0"
                                HorizontalAlignment="Stretch"
                                IsEditable="False"
                                ItemsSource="{Binding SomeValueItems}"
                                SelectedItem="{Binding SomeValue}" />
                            <telerik:RadDateTimePicker
                                Grid.Column="0"
                                HorizontalAlignment="Stretch"
                                InputMode="DatePicker"
                                DateTimeWatermarkContent="{x:Null}"
                                SelectedValue="{Binding DateValue, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}"
                                Visibility="Collapsed" />
                        </Grid>
                    </DataTemplate>
                </telerik:GridViewDataColumn.CellEditTemplate>
            </telerik:GridViewDataColumn>
        </telerik:RadGridView.Columns>
    </telerik:RadGridView>
</Window>

Stenly
Telerik team
 answered on 07 Aug 2025
1 answer
12 views

Hello, I want to add a custom palette with its own names and colors in WPF. But seems like I can only work with built-in MainPalette, HeaderPalette, AdditionalContent

The image below shows my intention. I want to add not only 2 of them, but as many as I want.

Stenly
Telerik team
 answered on 29 Jul 2025
1 answer
13 views
Is there a way to use RadMaskedDateTimeInput with RadDateTimePicker?  Users want to be able dates in MM/dd/yyyy format (without typing the slashes) or use the calendar picker.  I believe RadDateTimePicker uses RadWatermarkTextBox which does not have tight input control.
Martin Ivanov
Telerik team
 answered on 29 Jul 2025
2 answers
9 views
Is there anyway to disable this functionality in the pdf viewer so that I can handle zooming manually?
Rob
Top achievements
Rank 1
Iron
Iron
Iron
 answered on 22 Jul 2025
1 answer
25 views

I am using the Material Theme, here's my app.xaml code


<Application x:Class="Desktop_Application.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Application.Resources>
        
        <ResourceDictionary>
            <!-- Global default font size -->
            <Style TargetType="{x:Type Control}">
                <Setter Property="FontSize" Value="8"/>
            </Style>
            
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Material;component/Themes/System.Windows.xaml"/>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Material;component/Themes/Telerik.Windows.Controls.Chart.xaml"/>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Material;component/Themes/Telerik.Windows.Controls.Data.xaml"/>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Material;component/Themes/Telerik.Windows.Controls.FixedDocumentViewers.xaml"/>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Material;component/Themes/Telerik.Windows.Controls.GridView.xaml"/>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Material;component/Themes/Telerik.Windows.Controls.ImageEditor.xaml"/>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Material;component/Themes/Telerik.Windows.Controls.Input.xaml"/>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Material;component/Themes/Telerik.Windows.Controls.Navigation.xaml"/>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Material;component/Themes/Telerik.Windows.Controls.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>
</Application>
However, the application does not reflect the new font size, is there a way to do it?
Martin Ivanov
Telerik team
 answered on 16 Jul 2025
1 answer
16 views

I using the <telerik:RadDatePicker> 

 DisplayFormat = (Long or short) only there I need a customer format how we archive.

 

Example : 1 July 2025, 1 JUL 2025

Stenly
Telerik team
 answered on 14 Jul 2025
1 answer
10 views

Hello,

I need to change the color of the RadVirtualKeyboardWindow's close button. At the moment it is not viewable very good. I use Material style around in my application, but it seems that it does not completly fit my needs. 

I tried to change the button's beahviour like this:


<Style TargetType="telerik:RadVirtualKeyboardWindow">
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="telerik:RadVirtualKeyboardWindow">
                <Grid>
                    <!-- Fensterinhalt -->
                    <Border Background="{TemplateBinding Background}">
                        <ContentPresenter />
                    </Border>

                    <!-- Schließen-Button -->
                    <Button x:Name="PART_CloseButton"
                            Width="24" Height="24"
                            HorizontalAlignment="Right"
                            VerticalAlignment="Top"
                            Margin="5"
                            Background="DarkRed"
                            Foreground="White"
                            BorderBrush="Transparent"
                            Content="✕"
                            FontWeight="Bold"
                            Cursor="Hand"/>
                </Grid>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>

But that actually lead to a very long button and could not change that either:

What can I try next?

Thanks and best regards,

Ferdinand

Stenly
Telerik team
 answered on 09 Jul 2025
1 answer
22 views

I have placed a RadialGauge with RadialScale inside a ViewBox.  To get the RadialGauge to display correctly, I have bound the height and width of the RadialGauge to the actual height and width of the the Grid that holds the RadialGauge.  The RadialGauge sizes correctly to the ViewBox although the labels actually get smaller as the Viewbox stretches to fill the window it is in. How do I get the  Indicator label size to change when the size of the ViewBox is changed?

<Window x:Class="GaugeTest.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:telerik="http://schemas.telerik.com/2008/xaml/presentation"
        xmlns:local="clr-namespace:GaugeTest"
        mc:Ignorable="d"
        Title="MainWindow" Height="450" Width="800" x:Name="TheWindow"
        >
    <Grid Margin="0" x:Name="MainV" >
        <Viewbox x:Name="VBox" 
                HorizontalAlignment="Center" VerticalAlignment="Center"                    
                Stretch="Uniform">

            <telerik:RadRadialGauge Height="{Binding ElementName=MainV, Path=ActualHeight}" Width="{Binding ElementName=MainV, Path=ActualWidth}">
                <telerik:RadialScale   Radius="1"  
                    Min="0" 
                    Max="30"
                    MajorTickStep="5"
                    Foreground="Black"
                             Stroke="Black"
                             StrokeThickness="1"
                             Fill="White"                 
                             >
                    <telerik:RadialScale.Indicators >
                        <telerik:Needle Name="needle" Foreground="Black" Value="15" />
                        <telerik:Pinpoint Foreground="Black"/>
                    </telerik:RadialScale.Indicators>

                </telerik:RadialScale>
            </telerik:RadRadialGauge>
        </Viewbox>
    </Grid>
</Window>
 
Martin Ivanov
Telerik team
 answered on 26 Jun 2025
1 answer
32 views
We use a Telerik via NuGet packages.  All of our developers have followed Telerik's instructions to build by putting our license files in our personal folders here.

%appdata%/telerik 

This all works just fine.

However our nightly build is performed by a service account.  Where do I put the telerik-license.txt file for that?  I do not want to add it to the project.   

Is there some global folder -- available to ALL users -- that the Telerik build process can copy it from?  Something not  local to the current user like %appdata%?
Martin Ivanov
Telerik team
 answered on 05 Jun 2025
Narrow your results
Selected tags
Tags
+113 more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?