The CollectionEditor control has a resize functionality which allows you to drag its bottom right cornet, which changes the Width and Height of the root element in the ControlTemplate of the CollectionEditor. When hosted in CollectionEditorPicker, the CollectionEditor is placed in a RadDropDownButton's DropDownContent which is basically a Popup with Placement=Bottom. When the popup goes near the bottom edge of the screen, thus doesn't having enough height to render all its contents, the Popup is automatically re-positioned so it aligns top to its parent element (the RadDropDownButton in this case). In other words, the Popup starts behaving as if its Placement=Top.
This behavior leads to issues with the vertical resizing of the CollectionEditor control. Firstly, when the Popup is automatically aligned using the Top placement, if you resize to a size small enough to fit under the picker control, the Popup gets re-positioned below the picker. Secondly, if you vertically resize the CollectionEditor to a bigger size while aligned to Top, the resizing action will increase the control height, but because of the alignment it will look like the resizing happens from the top corner of the control. In this scenario, also the buttons of the CollectionEditor disappear.
To work this around, you can disable the resizing behavior of the CollectionEditor control.
static MainWindow()
{
EventManager.RegisterClassHandler(typeof(CollectionEditor), CollectionEditor.LoadedEvent, new RoutedEventHandler(CollectionEditor_Loaded));
}
private static void CollectionEditor_Loaded(object sender, RoutedEventArgs e)
{
var collectionEditor = (CollectionEditor)sender;
var popupParent = collectionEditor.ParentOfType<Popup>();
if (popupParent != null && popupParent.PlacementTarget.GetType() == typeof(CollectionEditorPicker))
{
collectionEditor.ResizeGripperVisibility = Visibility.Collapsed;
}
}
The position of the popup representing the IntelliPrompt is wrong when shown on the monitor with the higher DPI scale, in a setup with two monitors with different DPI settings. For example, if one monitor has 100% DPI scale and the other 125%, the position of the popup will be wrong when the app is on the 125% monitor.
To work this around, use the Caret visual as the PlacementTarget for the popup and set its offsets to 0 after it is shown.
private void RadSyntaxEditor_PreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e)
{
if (KeyboardModifiers.IsControlDown && e.Key == Key.Space)
{
e.Handled = true;
var editor = (RadSyntaxEditor)sender;
CaretPosition startPosition = new CaretPosition(editor.CaretPosition);
CaretPosition endPosition = new CaretPosition(editor.CaretPosition);
editor.IntelliPrompts.CompletionListWindow.Show(startPosition, endPosition);
editor.IntelliPrompts.CompletionListWindow.HorizontalOffset = 0;
editor.IntelliPrompts.CompletionListWindow.VerticalOffset = 0;
}
}
private void RadSyntaxEditor_Loaded(object sender, System.Windows.RoutedEventArgs e)
{
var editor = (RadSyntaxEditor)sender;
var caret = editor.FindChildByType<Telerik.Windows.Controls.SyntaxEditor.UI.Caret>();
editor.IntelliPrompts.CompletionListWindow.PlacementTarget = caret;
editor.IntelliPrompts.CompletionListWindow.Placement = System.Windows.Controls.Primitives.PlacementMode.Bottom;
}
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)
RichTextBox: Bullet list with several levels is not viewed correctly in WordPad.
In Word, this works as expected. When the document is imported into RadRichTextBox, this works as well.
The PDF document with images shows black canvas:
NOTE:
Works OK in version 2023.2.713Introduce events similar to the PageRenderStarted and PageRenderCompleted ones that the Telerik UI for WinForms RadPdfViewer provides:
WinForms PdfViewer How-To Handle Rendering Events - Telerik UI for WinForms
Enable the customers to create and modify .pptx (PowerPoint) files . They need processing as well as showing such documents.
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);
};