TypeAccessException occurs in .NET Framework projects when using internal class for the data point models. The error doesn't occur in .NET 8 projects.
dsa
System.TypeAccessException: 'Attempt by method 'DynamicClass.Telerik_DynamicGetter_Argument(System.Object)' to access type 'WpfApp29.ChartPoint' failed.' at Telerik.Windows.Controls.Chart.dll!Telerik.Windows.Controls.ChartView.PropertyNameDataPointBinding.GetValue(object instance) Telerik.Windows.Controls.Chart.dll!Telerik.Windows.Controls.ChartView.ScatterSeriesDataSource.InitializeBinding(Telerik.Windows.Controls.ChartView.DataPointBindingEntry binding) Telerik.Windows.Controls.Chart.dll!Telerik.Windows.Controls.ChartView.ChartSeriesDataSource.GenerateDataPoint(object dataItem, int index) Telerik.Windows.Controls.Chart.dll!Telerik.Windows.Controls.ChartView.ChartSeriesDataSource.BindCore(System.Collections.IEnumerable source)
Telerik.Windows.Controls.Chart.dll!Telerik.Windows.Controls.ChartView.ChartSeriesDataSource.Bind(System.Collections.IEnumerable itemSource)
Telerik.Windows.Controls.Chart.dll!Telerik.Windows.Controls.ChartView.ChartSeriesDataSource.Rebind(System.Collections.IEnumerable oldSource, System.Collections.IEnumerable newSource, bool shouldUpdateSelectedPoints) Telerik.Windows.Controls.Chart.dll!Telerik.Windows.Controls.ChartView.ChartSeriesDataSource.ItemsSource.set(System.Collections.IEnumerable value) Telerik.Windows.Controls.Chart.dll!Telerik.Windows.Controls.ChartView.ChartSeries.InitDataBinding() Line Telerik.Windows.Controls.Chart.dll!Telerik.Windows.Controls.ChartView.ScatterPointSeries.InitDataBinding() Telerik.Windows.Controls.Chart.dll!Telerik.Windows.Controls.ChartView.ChartSeries.OnApplyTemplate() Telerik.Windows.Controls.Chart.dll!Telerik.Windows.Controls.ChartView.PointTemplateSeries.OnApplyTemplate()
To work this around, upgrade the target framework of the project to .NET 8. Or use the GenericDataPointBinding class for the binding properties of the series (XValueBinding, YValueBinding, etc.), instead of the default PropertyNameDataPointBinding.
The selection a RadComboBox hosted in RadDataForm gets cleared on commit changes. This happens when the RadComboBox is added in the EditTemplate and its IsEditable is set to True. Committing the edit clears the TextBox of the ComboBox, which clears the selection.
To work this around, subscribe to the EditEnding event of RadDataForm and clear the DataContext of the RadComboBox element.
private void RadDataForm_EditEnding(object sender, Telerik.Windows.Controls.Data.DataForm.EditEndingEventArgs e)
{
var dataForm = (RadDataForm)sender;
var myField = dataForm.ChildrenOfType<DataFormDataField>().FirstOrDefault(df => df.Name == "myField");
if (myField != null)
{
var comboBox = (RadComboBox)myField.Content;
comboBox.DataContext = null;
}
}
When filter is added to merged cells, there should be a single filter icon displayed in the combined cell. Instead, multiple filters appear - one for each column in the range of the merged cells.
The RichTextBox internal logic that imports .docx documents (DocxFormatProvider) doesn't support elements that don't need direct content, but have both start and end tags. Instead such elements should use self-closing tags.
For example, instead of <w:vertAlign w:val="baseline"></w:vertAlign> it should be <w:vertAlign w:val="baseline"/>
When such element is read during import, issues may occur. Two main known issues here are with the w:vertAlign and Relationship tags.
Using
<w:vertAlign w:val="baseline"></w:vertAlign>
instead of
<w:vertAlign w:val="baseline"/>
throws NullReferenceException with the following stack trace:
System.NullReferenceException: 'Object reference not set to an instance of an object.' Telerik.Windows.Documents.FormatProviders.OpenXml.dll!Telerik.Windows.Documents.FormatProviders.OpenXml.OpenXmlHelper.ConvertStringToBaselineAlignment(string value) Line 168 C# Telerik.Windows.Documents.FormatProviders.OpenXml.dll!Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.SpanStyleImporter.ReadBaselineAlignment(Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Parsing.Style style) Line 243 C# Telerik.Windows.Documents.FormatProviders.OpenXml.dll!Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.SpanStyleImporter.ReadStyle(Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Parsing.Style style) Line 88 C# Telerik.Windows.Documents.FormatProviders.OpenXml.dll!Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.StyleDefinitionsImporter.ReadSpanStyleProperties(Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Parsing.Style style) Line 278 C# Telerik.Windows.Documents.FormatProviders.OpenXml.dll!Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.StyleDefinitionsImporter.ReadStyle() Line 188 C# Telerik.Windows.Documents.FormatProviders.OpenXml.dll!Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.StyleDefinitionsImporter.Import() Line 67 C# Telerik.Windows.Documents.FormatProviders.OpenXml.dll!Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.DocxImporter.ReadXmlContentFromPackage(Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.DocxPartImporterBase importer) Line 430 C# Telerik.Windows.Documents.FormatProviders.OpenXml.dll!Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.DocxImporter.ReadXmlContentAndRelationsFromPackage(Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.DocxPartImporterBase importer) Line 406 C# Telerik.Windows.Documents.FormatProviders.OpenXml.dll!Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.DocxImporter.Import() Line 190 C# Telerik.Windows.Documents.FormatProviders.OpenXml.dll!Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.DocxFormatProvider.Import(System.IO.Stream input) Line 147 C# Telerik.Windows.Documents.dll!Telerik.Windows.Documents.FormatProviders.DocumentFormatProviderBase.Import(byte[] input) Line 90 C#
Using
<Relationship Id="rId00004" Target="styles.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles"></Relationship>
instead of
<Relationship Id="rId00004" Target="styles.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles"/>
throws KeyNotFoundException with the following stack trace:
KeyNotFoundException: The given key was not present in the dictionary. System.ThrowHelper.ThrowKeyNotFoundException() in ThrowHelper.cs System.Collections.Generic.Dictionary<TKey, TValue>.this[TKey].get(TKey) in Dictionary.cs Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.PartRelationsImporter.GetRelationByID(string) in PartRelationsImporter.cs Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.DocxImporter.GetRelationByID(string) in DocxImporter.cs Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.MainDocumentImporter.BuildSection() in MainDocumentImporter.cs Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.MainDocumentImporter.BuildBody() in MainDocumentImporter.cs Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.MainDocumentImporter.BuildDocument() in MainDocumentImporter.cs Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.MainDocumentImporter.Import() in MainDocumentImporter.cs Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.DocxImporter.ReadXmlContentFromPackage(Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.DocxPartImporterBase) in DocxImporter.cs Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.DocxImporter.ReadXmlContentAndRelationsFromPackage(Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.DocxPartImporterBase) in DocxImporter.cs
To work this around, import the document with the WordsProcessing library. If you need to display it in RadRichTextBox, you can export it again using the WordsProcessing library. This will normalize the tags. Then import it again using the RadDocument's DocxFormatProvider.
var dplDocxFormatProvider = new Telerik.Windows.Documents.Flow.FormatProviders.Docx.DocxFormatProvider();
RadFlowDocument flowDocument = dplDocxFormatProvider.Import(File.ReadAllBytes("../../../test.docx"), null);
var docBytes = dplDocxFormatProvider.Export(flowDocument, null);
File.WriteAllBytes("../../../modified-doc.docx", docBytes);
var rtbDocxFormatProvider= new Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.DocxFormatProvider();
RadDocument document = rtbDocxFormatProvider.Import(File.ReadAllBytes("../../../modified-doc.docx"));
Pressing the Enter key when a field editor is focused will scroll the vertical scrollbar to the topmost offset. This is reproducible when the properties are grouped. Also, the RenderMode should be set to Flat.
To work this around, change the RenderMode setting to Hierarchical right before the Enter key logic is executed and then return it back to Flat after some time.
private void RadPropertyGrid_PreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e)
{
var propertyGrid = (RadPropertyGrid)sender;
var currentMode = propertyGrid1.RenderMode;
propertyGrid.RenderMode = RenderMode.Hierarchical;
Dispatcher.BeginInvoke(new Action(() =>
{
propertyGrid.RenderMode = currentMode;
}));
}
Handle the case when the cell is too small and the value contains a decimal separator.
For example, see attached images.
Currently, the only customization that can be performed is using HyperlinkToolTipFormatString property of RadRichTextBox, which sets the format for all hyperlinks in the document of the control. It would be nice if it were possible to be able to set different tooltips.
Bold/Italic does not work for some font styles.
This might be a framework limitation in WPF: https://www.telerik.com/forums/some-fonts-are-not-able-to-bold-italic
Sample fonts list:
When using an INotifyCollectionChanged (like ObservableCollection<T>), RadGridView's data engine subscribes to the CollectionChanged event of the bound collection.
It seems that the WPF views are recreated when you connect to a running remote desktop session or switch the user to a session where the corresponding WPF app is already opened. This creates new instances of all controls, but no unload or another disposal event happens. In this case, the logic that subscribes to the CollectionChanged event again is triggered for the new RadGridView, but the old one never detaches from the event. This causes a memory leak.
If you connect to the session multiple times, the CollectionChanged handler will be attached multiple times leading to a memory leak.
To work this around, set the ItemsSource of RadGridView to null in the SystemEvents.SessionChanged static event.
private void SystemEvents_SessionSwitch(object sender, SessionSwitchEventArgs e)
{
if (e.Reason == SessionSwitchReason.SessionLock)
{
BindingOperations.ClearAllBindings(this.RadGridViewFixed);
}
}