A compilation error occurs in a class library project which doesn't use any Telerik code, but it is referenced in another project which installs the Telerik.Licensing NuGet package. The error reproduces only if the class library project contains .xaml files.
The error message from the class library project is the following:
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.WinFx.targets(268,9): error MC1000: Unknown build error, 'Cannot resolve dependency to assembly 'Telerik.Licensing.Runtime, Version=1.4.6.0, Culture=neutral, PublicKeyToken=keyhere' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.'
To workaround this, you can add assembly references to the Telerik dlls in the main project (including Telerik.Licensing.Runtime), instead of using NuGet packages.
Alternatively, you can install the Telerik.Licensing NuGet package also in the class library.
<ItemGroup>
<PackageReference Include="Telerik.Licensing" Version="1.4.*" />
</ItemGroup>
Note that with this approach you will see a message in the output that no license is installed, even if you have one. However, for now (versions from 1.4.6 to 1.4.12, which is the latest at the moment of writting this post), the error won't apply any compile or runtime restrictions on the UI or the functionality.
Currently, the DataFormatString property of the columns is applied only to the top-level rows and not to the child ones.
To work this around, create a new DataTemplate for the CellTemplate property of the column and set the StringFormat property of the Binding instance for the element that will be used to display the cell's value in view mode.
<telerik:GridViewDataColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding MyPropertyValue, StringFormat=N2}"/>
</DataTemplate>
</telerik:GridViewDataColumn.CellTemplate>
The VisualizationLayer will support using the collection views such as System.Windows.Data.ListCollectionView as its items source.
The horizontal ScrollBar of RadSpreadsheet is missing the bottom border of its track. Additional to that there is a slight offset between the right end of the viewport and the right button of the ScrollBar.
To work this around, set the Margin of the horizontal ScrollBar to 0, and modify its ControlTemplate so that it adds a bottom border for the track's RepeatButton elements.
private void RadSpreadsheet_Loaded(object sender, RoutedEventArgs e)
{
var spreadsheet = (RadSpreadsheet)sender;
var scrollBar = spreadsheet.ChildrenOfType<ScrollBar>().FirstOrDefault(x => x.Name == "HorizontalScrollBar");
scrollBar.Margin = new Thickness(0);
scrollBar.Template = (ControlTemplate)this.Resources["MyCustomScrollBarTemplate"];
}
NullReferenceException occurs when the the automation peers creation for the rows goes over 10,000 peers (the MaxCachedPeersSize setting of the GridViewDataControlAutomationPeer). The exception occurs only when the 'record' modifier is used in the class definition. For example:
public record class MyClass(int Id)
{
}
The exception stacktrace is:
System.NullReferenceException: 'Object reference not set to an instance of an object.'
peer was null.
Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Automation.Peers.GridViewDataControlAutomationPeer.ClearPeer(Telerik.Windows.Automation.Peers.DataItemAutomationPeer peer) Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Automation.Peers.GridViewDataControlAutomationPeer.GetOrCreateItemPeer(object item, int index) Line 288 C# Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Automation.Peers.GridViewRowAutomationPeer.FindDataItemAutomationPeer(System.Collections.Generic.List<System.Windows.Automation.Peers.AutomationPeer> childPeers) Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Automation.Peers.GridViewRowAutomationPeer.GetChildrenCore()
.
To work this around use the "class" modifier instead of "record". For example, instead of:
public record class MyClass(int Id)
{
}
Use:
public class MyClass
{
public int Id { get; set; }
}
Or alternatively, increase the MaxCachedPeersSize value.
ArgumentOutOfRangeException occurs when the ItemsSource of RadComboBox gets reset. To recreate this the IsSelected property of RadComboBoxItem should be bound too and multiple selection should be allowed.
To work this around, you can disable the autiomation peers globally:
AutomationManager.AutomationMode = AutomationMode.Disabled;
Or you disable them only for the RadComboBox:
public class CustomComboBox : RadComboBox
{
protected override AutomationPeer OnCreateAutomationPeer()
{
return null;
}
}
The stacktrace:
System.ArgumentOutOfRangeException: 'Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')'
System.Private.CoreLib.dll!System.ThrowHelper.ThrowArgumentOutOfRange_IndexMustBeLessException() Unknown
System.Private.CoreLib.dll!System.Collections.Generic.List<System.__Canon>.this[int].get(int index) Unknown Telerik.Windows.Controls.Input.dll!Telerik.Windows.Automation.Peers.RadComboBoxAutomationPeer.RaiseSelectionEvents(System.Windows.Controls.SelectionChangedEventArgs e) Line 202 C# Telerik.Windows.Controls.Input.dll!Telerik.Windows.Controls.RadComboBox.OnSelectionChanged(System.Windows.Controls.SelectionChangedEventArgs e) Line 1927 C#
PresentationFramework.dll!System.Windows.Controls.Primitives.Selector.SetSelectedHelper(object item, System.Windows.FrameworkElement UI, bool selected) Unknown
PresentationFramework.dll!System.Windows.Controls.Primitives.Selector.NotifyIsSelectedChanged(System.Windows.FrameworkElement container, bool selected, System.Windows.RoutedEventArgs e) Unknown
PresentationCore.dll!System.Windows.EventRoute.InvokeHandlersImpl(object source, System.Windows.RoutedEventArgs args, bool reRaised) Unknown
PresentationCore.dll!System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject sender, System.Windows.RoutedEventArgs args) Unknown
Telerik.Windows.Controls.Input.dll!Telerik.Windows.Controls.RadComboBoxItem.OnSelected(System.Windows.RoutedEventArgs e) Line 59 C#
PresentationFramework.dll!System.Windows.Controls.ListBoxItem.OnIsSelectedChanged(System.Windows.DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e) Unknown
PresentationFramework.dll!System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs e) Unknown
WindowsBase.dll!System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs args) Unknown
WindowsBase.dll!System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex entryIndex, System.Windows.DependencyProperty dp, System.Windows.PropertyMetadata metadata, System.Windows.EffectiveValueEntry oldEntry, ref System.Windows.EffectiveValueEntry newEntry, bool coerceWithDeferredReference, bool coerceWithCurrentValue, System.Windows.OperationType operationType) Unknown
PresentationFramework.dll!System.Windows.StyleHelper.ApplyStyleOrTemplateValue(MS.Internal.FrameworkObject fo, System.Windows.DependencyProperty dp) Unknown
PresentationFramework.dll!System.Windows.StyleHelper.InvalidateContainerDependents(System.Windows.DependencyObject container, ref MS.Utility.FrugalStructList<System.Windows.ContainerDependent> exclusionContainerDependents, ref MS.Utility.FrugalStructList<System.Windows.ContainerDependent> oldContainerDependents, ref MS.Utility.FrugalStructList<System.Windows.ContainerDependent> newContainerDependents) Unknown
PresentationFramework.dll!System.Windows.StyleHelper.DoStyleInvalidations(System.Windows.FrameworkElement fe, System.Windows.FrameworkContentElement fce, System.Windows.Style oldStyle, System.Windows.Style newStyle) Unknown
PresentationFramework.dll!System.Windows.StyleHelper.UpdateStyleCache(System.Windows.FrameworkElement fe, System.Windows.FrameworkContentElement fce, System.Windows.Style oldStyle, System.Windows.Style newStyle, ref System.Windows.Style styleCache) Unknown
PresentationFramework.dll!System.Windows.FrameworkElement.OnStyleChanged(System.Windows.DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e) Unknown
PresentationFramework.dll!System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs e) Unknown
WindowsBase.dll!System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs args) Unknown
WindowsBase.dll!System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex entryIndex, System.Windows.DependencyProperty dp, System.Windows.PropertyMetadata metadata, System.Windows.EffectiveValueEntry oldEntry, ref System.Windows.EffectiveValueEntry newEntry, bool coerceWithDeferredReference, bool coerceWithCurrentValue, System.Windows.OperationType operationType) Unknown
WindowsBase.dll!System.Windows.DependencyObject.InvalidateProperty(System.Windows.DependencyProperty dp, bool preserveCurrentValue) Unknown
PresentationFramework.dll!System.Windows.FrameworkElement.UpdateStyleProperty() Unknown
PresentationFramework.dll!System.Windows.FrameworkElement.OnInitialized(System.EventArgs e) Unknown
Telerik.Windows.Controls.Input.dll!Telerik.Windows.Controls.RadComboBoxItem.OnInitialized(System.EventArgs e) Line 106 C#
PresentationFramework.dll!System.Windows.FrameworkElement.OnVisualParentChanged(System.Windows.DependencyObject oldParent) Unknown
PresentationFramework.dll!System.Windows.Controls.ListBoxItem.OnVisualParentChanged(System.Windows.DependencyObject oldParent) Unknown
PresentationCore.dll!System.Windows.Media.Visual.FireOnVisualParentChanged(System.Windows.DependencyObject oldParent) Unknown
PresentationCore.dll!System.Windows.Media.Visual.AddVisualChild(System.Windows.Media.Visual child) Unknown
PresentationCore.dll!System.Windows.Media.VisualCollection.Add(System.Windows.Media.Visual visual) Unknown
PresentationFramework.dll!System.Windows.Controls.UIElementCollection.AddInternal(System.Windows.UIElement element) Unknown
PresentationFramework.dll!System.Windows.Controls.Panel.GenerateChildren() Unknown
PresentationFramework.dll!System.Windows.Controls.Panel.OnItemsChangedInternal(object sender, System.Windows.Controls.Primitives.ItemsChangedEventArgs args) Unknown
PresentationFramework.dll!System.Windows.Controls.Panel.OnItemsChanged(object sender, System.Windows.Controls.Primitives.ItemsChangedEventArgs args) Unknown
PresentationFramework.dll!System.Windows.Controls.ItemContainerGenerator.OnRefresh() Unknown
PresentationFramework.dll!System.Windows.Controls.ItemContainerGenerator.OnCollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs args) Unknown
WindowsBase.dll!System.Windows.WeakEventManager.ListenerList<System.Collections.Specialized.NotifyCollectionChangedEventArgs>.DeliverEvent(object sender, System.EventArgs e, System.Type managerType) Unknown
WindowsBase.dll!System.Windows.WeakEventManager.DeliverEvent(object sender, System.EventArgs args) Unknown
PresentationFramework.dll!System.Windows.Data.CollectionView.OnCollectionChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs args) Unknown
WindowsBase.dll!System.Windows.WeakEventManager.ListenerList<System.Collections.Specialized.NotifyCollectionChangedEventArgs>.DeliverEvent(object sender, System.EventArgs e, System.Type managerType) Unknown
WindowsBase.dll!System.Windows.WeakEventManager.DeliverEvent(object sender, System.EventArgs args) Unknown
PresentationFramework.dll!System.Windows.Data.CollectionView.OnCollectionChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs args) Unknown
PresentationFramework.dll!System.Windows.Data.ListCollectionView.RefreshOverride() Unknown
PresentationFramework.dll!System.Windows.Data.CollectionView.RefreshInternal() Unknown
PresentationFramework.dll!System.Windows.Data.CollectionView.DeferHelper.Dispose() Unknown
PresentationFramework.dll!System.Windows.Controls.ItemCollection.SetCollectionView(System.Windows.Data.CollectionView view) Unknown
PresentationFramework.dll!System.Windows.Controls.ItemsControl.OnItemsSourceChanged(System.Windows.DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e) Unknown
PresentationFramework.dll!System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs e) Unknown
WindowsBase.dll!System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs args) Unknown
WindowsBase.dll!System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex entryIndex, System.Windows.DependencyProperty dp, System.Windows.PropertyMetadata metadata, System.Windows.EffectiveValueEntry oldEntry, ref System.Windows.EffectiveValueEntry newEntry, bool coerceWithDeferredReference, bool coerceWithCurrentValue, System.Windows.OperationType operationType) Unknown
WindowsBase.dll!System.Windows.DependencyObject.InvalidateProperty(System.Windows.DependencyProperty dp, bool preserveCurrentValue) Unknown
PresentationFramework.dll!System.Windows.Data.BindingExpression.TransferValue(object newValue, bool isASubPropertyChange) Unknown
PresentationFramework.dll!MS.Internal.Data.PropertyPathWorker.UpdateSourceValueState(int k, System.ComponentModel.ICollectionView collectionView, object newValue, bool isASubPropertyChange) Unknown
PresentationFramework.dll!MS.Internal.Data.ClrBindingWorker.OnSourcePropertyChanged(object o, string propName) Unknown
WindowsBase.dll!System.Windows.WeakEventManager.ListenerList<System.ComponentModel.PropertyChangedEventArgs>.DeliverEvent(object sender, System.EventArgs e, System.Type managerType) Unknown
WindowsBase.dll!System.ComponentModel.PropertyChangedEventManager.OnPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs args) Unknown
Telerik.Windows.Controls.dll!Telerik.Windows.Controls.ViewModelBase.OnPropertyChanged(string propertyName) Unknown
> WpfApp180.dll!WpfApp180.MainViewModel.ResetData() Line 44 C#
We are using the RadRichTextbox limiting the width size and configured to wrap the text, automatically increasing its height as needed. While this functionality works correctly for most text, it fails in cases where a line ends with spaces. These trailing spaces extend beyond the control's visible boundaries, making them invisible on-screen, yet they remain present in the RadDocument.
To reproduce: Create a RadRichTextbox with limited width and auto adjusted height. Type in underlined text on first line and add a lot of spaces that go behind the visible width. Type in more text to see the visible underlined text go to the next line (while hiding the added underlined spaces of the previous line). Exporting to RadDocument shows the extra underlined spaces that RadRichTextbox does not.