The fill selection stops working, after a filtering is applied and the currently selected cell is filtered out (it gets hidden). This prevents from displaying the fill selection cross displayed when you hover the bottom right corner of a selected cell. Any further changes in the selection doesn't re-enable the selection fill feature.
To work this around, you can set the IsEnabled property of the FillSelection on selection changed.
private RadWorksheetEditor activeWorksheetEditor;
public MainWindow()
{
InitializeComponent();
this.spreadsheet.ActiveSheetEditorChanged += (s, e) =>
{
if (activeWorksheetEditor != null)
{
activeWorksheetEditor.Selection.SelectionChanged -= Selection_SelectionChanged;
}
activeWorksheetEditor = this.spreadsheet.ActiveWorksheetEditor;
activeWorksheetEditor.Selection.SelectionChanged += Selection_SelectionChanged;
};
}
private void Selection_SelectionChanged(object? sender, EventArgs e)
{
this.spreadsheet.ActiveWorksheetEditor.Selection.FillSelection.IsEnabled = true;
}
The line break symbol (Shift+Enter) is treated as a text character and it gets measured in the document position calculations executed when you click at the end of the document (somewhere after the line break symbol which ends the line).
This causes two visual issues. The first one is that the caret goes after the line break symbol, which means that when ShowFormattingSymbols is False an empty space (non-existing in the document) is added at the end of the line. Even if ShowFormattingSymbols=true and the line break symbol gets display, it is not expected for ,the caret to get positioned after the symbol.
The second issues is that, when you start typing after you click at the end of the line, the caret position is corrected, but this leads to a jumps of the caret with one character to the left, which brings an unpleasant visual glitch.
To work this around, you can create a custom MouseSelectionHandler and override its RegisterDocumentMouseDown method. This will allow you to check if the caret is placed after the line break symbol and manually update the caret position if that is the case.
public class CustomMouseSelectionHandler : MouseSelectionHandler
{
private IDocumentEditorPresenter presenter;
private RadDocument document;
public CustomMouseSelectionHandler(RadDocument document, IDocumentEditorPresenter presenter)
: base(document, presenter)
{
this.presenter = presenter;
this.document = document;
}
public override void RegisterDocumentMouseDown(bool ctrlPressed, bool shiftPressed, Point position, UIElement originalSource = null, SourceType source = SourceType.Mouse)
{
base.RegisterDocumentMouseDown(ctrlPressed, shiftPressed, position, originalSource, source);
var box = this.document.CaretPosition.GetCurrentSpanBox();
if (box != null && box.AssociatedSpan.Text == "¬")
{
document.CaretPosition.MoveToCurrentLineEnd();
}
}
} this.richTextBox.Loaded += (s, args) =>
{
var presenter = (DocumentPresenterBase)this.richTextBox.ActiveEditorPresenter;
presenter.MouseSelectionHandler = new CustomMouseSelectionHandler(this.richTextBox.Document, presenter);
};
.Net framework 4.7.2
Telerik WPF Version 2025.1.211.462
When developing an application using Telerik's RadHighlightTextBlock control, I encountered the following issues:
When attempting to dynamically update the control's `Text` and `HighlightText` properties through data binding, the control fails to display the updated content correctly. Specifically:
I have confirmed that:
I suspect this might be an issue with RadHighlightTextBlock's internal update handling mechanism, or it may require specific settings to properly handle dynamic update scenarios.
<Window x:Class="RadHighlightTextBlock_Issue.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:RadHighlightTextBlock_Issue"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Window.Resources>
<local:MyViewModel x:Key="MyViewModel"/>
</Window.Resources>
<StackPanel>
<telerik:RadHighlightTextBlock x:Name="highlightTextBlock"
Text="{Binding Source={StaticResource MyViewModel}, Path=SelectedItem.Description}"
HighlightText="{Binding Source={StaticResource MyViewModel}, Path=SelectedItem.HighlightText}"
HighlightForeground="Red"
HighlightBackground="Yellow"
FontSize="16"
Margin="10"/>
<telerik:RadButton Content="Content0" Command="{Binding Source={StaticResource MyViewModel}, Path=C0Command}"/>
<telerik:RadButton Content="Content1" Command="{Binding Source={StaticResource MyViewModel}, Path=C1Command}"/>
</StackPanel>
</Window>using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Windows;
using System.Windows.Input;
namespace RadHighlightTextBlock_Issue
{
/// <summary>
/// MainWindow.xaml 的互動邏輯
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void RadButton_Click(object sender, RoutedEventArgs e)
{
highlightTextBlock.Text = "This is a sample text to demonstrate the RadHighlightTextBlock control.";
}
private void RadButton_Click_1(object sender, RoutedEventArgs e)
{
highlightTextBlock.Text = "This is another sample text for the second button.";
}
}
public class MyViewModel : INotifyPropertyChanged
{
public ObservableCollection<DataItem> Items { get; set; }
public MyViewModel()
{
Items = new ObservableCollection<DataItem>
{
new DataItem { HighlightText = "sample", Description = "This is a sample description." },
new DataItem { HighlightText = "second", Description = "This is the second item description." },
new DataItem { HighlightText = "text", Description = "This item contains the word text." }
};
SelectedItem = Items.FirstOrDefault();
}
public ICommand C0Command => new RelayCommand<object>((obj) =>
{
SelectedItem = Items.FirstOrDefault();
});
public ICommand C1Command => new RelayCommand<object>((obj) =>
{
SelectedItem = Items.LastOrDefault();
});
private DataItem _selectedItem;
public DataItem SelectedItem
{
get { return _selectedItem; }
set
{
if (_selectedItem != value)
{
_selectedItem = value;
OnPropertyChanged();
}
}
}
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = "")
{
var handler = PropertyChanged;
if (handler != null)
{
handler(this, new PropertyChangedEventArgs(propertyName));
}
}
}
public class DataItem
{
public string HighlightText { get; set; }
public string Description { get; set; }
}
/*Implement RelayCommand...*/
}
ArgumentException occurs when using the voice typing feature of Windows (started with the Windows Key + H key combo) to convert speech to text in RadRichTextBox.
Exception stacktrace:
System.ArgumentException: 'Requested distance is outside the content of the associated document.'PresentationFramework.dll!System.Windows.Documents.TextPointer.TextPointer(System.Windows.Documents.TextContainer textContainer, int offset, System.Windows.Documents.LogicalDirection direction) PresentationFramework.dll!System.Windows.Documents.TextContainer.CreatePointerAtOffset(int offset, System.Windows.Documents.LogicalDirection direction) PresentationFramework.dll!System.Windows.Documents.TextParentUndoUnit.Do() PresentationFramework.dll!MS.Internal.Documents.UndoManager.Redo(int count) PresentationFramework.dll!System.Windows.Documents.TextStore.RedoQuietly(int count) PresentationFramework.dll!System.Windows.Documents.TextStore.SetFinalDocumentState(MS.Internal.Documents.UndoManager undoManager, System.Collections.Stack imeChangeStack, int appChangeCount, int imeSelectionAnchorOffset, int imeSelectionMovingOffset, int appSelectionAnchorOffset, int appSelectionMovingOffset) PresentationFramework.dll!System.Windows.Documents.TextStore.HandleCompositionEvents(int previousUndoCount) PresentationFramework.dll!System.Windows.Documents.TextStore.GrantLockWorker(MS.Win32.UnsafeNativeMethods.LockFlags flags) PresentationFramework.dll!System.Windows.Documents.TextStore.RequestLock(MS.Win32.UnsafeNativeMethods.LockFlags flags, out int hrSession)
Font weight, size and other current editing style properties are not preserved when document layout is performed, for example in the following cases: - the document is in web layout mode and the controls is resized - scroll bar changes its visibility. Steps to reproduce: - Set RadRichTextBox to Web layout mode. - Type a word, select it and make it bold. - Press enter and type a word - Repeat the previous step until RadRichTextBox height is reached and scrollbar appear. - Type a word. Expected: The last word is bold. Actual: The last word is not bold.
Working with the RadContextMenu that comes from the RadRichTextBoxUI, when having analytics enabled, produces a NullReferenceException.
Manually set the Menu property on the PreviewMouseLeftButtonUp event of the RadMenuItem:
static MainWindow()
{
EventManager.RegisterClassHandler(typeof(RadMenuItem), PreviewMouseLeftButtonUpEvent, new MouseButtonEventHandler(OnRadMenuItemPreviewMouseLeftButtonUp), true);
}
private static void OnRadMenuItemPreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
RadMenuItem radMenuItem = (RadMenuItem)sender;
RadContextMenu radContextMenu = radMenuItem.ParentOfType<RadContextMenu>();
if (radContextMenu != null)
{
PropertyInfo menuPropertyInfo = radMenuItem.GetType().GetProperty("Menu", BindingFlags.Public | BindingFlags.Instance);
if (menuPropertyInfo != null)
{
MethodInfo setMethod = menuPropertyInfo.GetSetMethod(true);
if (setMethod != null)
{
Application.Current.Dispatcher.BeginInvoke(new Action(() =>
{
setMethod.Invoke(radMenuItem, new object[] { radContextMenu });
}), System.Windows.Threading.DispatcherPriority.Background);
}
}
}
}
1. Click filter icon in column
2. Enter invalid value in filter input
3. Press Filter, the value gets underlined, suggesting some kind of error.

4. Click the place marked 1 and then 2.
This time, it seems a message appears about the cause of the error, but it doesn’t fit inside the control.

dialog.Filter = "Special files|.*_FileNamePart.txt"Pasting an invalid range of dates in the RadDateRangePicker, for example, "ABC", raises an exception.
To work around this behavior, you could subscribe to the Loaded event of RadDateRangePicker and retrieve the DateRangeMaskedInput element via the visual tree helper methods. Then, subscribe to its ValueChanging event and check whether the NewValue property of the event arguments contains any letters or characters that are not valid. If it does, set the Handled property to True.
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
this.dateRangePicker.Loaded += DateRangePicker_Loaded;
}
private void DateRangePicker_Loaded(object sender, RoutedEventArgs e)
{
DateRangeMaskedInput dateRangeMaskedInput = this.dateRangePicker.FindChildByType<DateRangeMaskedInput>();
if (dateRangeMaskedInput != null)
{
dateRangeMaskedInput.ValueChanging += DateRangeMaskedInput_ValueChanging;
}
}
private void DateRangeMaskedInput_ValueChanging(object? sender, Telerik.Windows.Controls.MaskedInput.RadMaskedInputValueChangingEventArgs e)
{
if (e.NewValue.ToString().Any(char.IsLetter))
{
e.Handled = true;
}
}
}
Hi Team,
We have a large-scale WPF application that uses the Telerik WPF RadGridView across multiple screens. We are experiencing significant memory growth issues. Upon deep analysis of the memory dump, we observed that the RadGridView continuously pushes DispatcherPriority items into the Dispatcher queue. We also noticed an internal timer within the RadGridView that appears to be active even after the control is no longer visible. We would like to understand how to completely detach and stop this internal timer once the control is removed from the screen, and why the RadGridView keeps pushing DispatcherItem entries into the Dispatcher queue.
Telerik Version : 2017.2.503.45