Completed
Last Updated: 23 Sep 2022 13:07 by ADMIN
Release R3 2022
Patric
Created on: 04 Aug 2022 08:52
Category: GanttView
Type: Bug Report
0
RadPictureBox: RadPictureBoxElement throws exception when using it in a custom GanttViewTextItemElement

Please refer to the attached sample project. After running it, the following error is observed:

************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
   at Telerik.WinControls.UI.RadPictureBoxElement.UpdateParentControl()
   at Telerik.WinControls.UI.RadPictureBoxElement.OnParentChanged(RadElement previousParent)
   at Telerik.WinControls.RadElement.SetParent(RadElement parent)
   at Telerik.WinControls.RadElement.ChangeCollection(RadElement child, ItemsChangeOperation changeOperation)
   at Telerik.WinControls.RadElementCollection.OnInsertComplete(Int32 index, Object value)
   at System.Collections.CollectionBase.System.Collections.IList.Add(Object value)
   at Telerik.WinControls.RadElementCollection.Add(RadElement value)
   at _1574930GanttCustomDataItem.RadForm1.customGanttViewTextViewCellElement.CreateChildElements() in C:\Projects\1574930GanttCustomDataItem\1574930GanttCustomDataItem\RadForm1.vb:line 75
   at Telerik.WinControls.RadElement.CallCreateChildElements()
   at Telerik.WinControls.RadElement.Construct()
   at Telerik.WinControls.RadElement..ctor()
   at Telerik.WinControls.RadItem..ctor()
   at Telerik.WinControls.UI.GanttViewTextViewCellElement..ctor(GanttViewTextItemElement owner, GanttViewTextViewColumn column)
   at _1574930GanttCustomDataItem.RadForm1.customGanttViewTextViewCellElement..ctor(GanttViewTextItemElement owner, GanttViewTextViewColumn column) in C:\Projects\1574930GanttCustomDataItem\1574930GanttCustomDataItem\RadForm1.vb:line 59
   at _1574930GanttCustomDataItem.RadForm1.radGanttView1_DataCellElementCreating(Object sender, GanttViewDataCellElementCreatingEventArgs e) in C:\Projects\1574930GanttCustomDataItem\1574930GanttCustomDataItem\RadForm1.vb:line 51
   at Telerik.WinControls.UI.RadGanttViewElement.OnDataCellCreating(GanttViewDataCellElementCreatingEventArgs e)
   at Telerik.WinControls.UI.GanttViewTextViewCellElementProvider.CreateElement(GanttViewTextViewColumn data, Object context)
   at Telerik.WinControls.UI.BaseVirtualizedElementProvider`1.GetElement(T data, Object context)
   at Telerik.WinControls.UI.BaseVirtualizedContainer`1.UpdateElement(Int32 position, T data)
   at Telerik.WinControls.UI.BaseVirtualizedContainer`1.MeasureElements()
   at Telerik.WinControls.UI.BaseVirtualizedContainer`1.MeasureOverride(SizeF availableSize)
   at Telerik.WinControls.RadElement.MeasureCore(SizeF availableSize)
   at Telerik.WinControls.RadElement.Measure(SizeF availableSize)
   at Telerik.WinControls.UI.LightVisualElement.MeasureElements(SizeF availableSize, SizeF clientSize, Padding borderThickness)
   at Telerik.WinControls.UI.LightVisualElement.MeasureOverride(SizeF availableSize)
   at Telerik.WinControls.RadElement.MeasureCore(SizeF availableSize)
   at Telerik.WinControls.RadElement.Measure(SizeF availableSize)
   at Telerik.WinControls.UI.VirtualizedStackContainer`1.MeasureElementCore(RadElement element, SizeF availableSize)
   at Telerik.WinControls.UI.VirtualizedStackContainer`1.MeasureElement(IVirtualizedElement`1 element)
   at Telerik.WinControls.UI.BaseVirtualizedContainer`1.MeasureElements()
   at Telerik.WinControls.UI.BaseVirtualizedContainer`1.MeasureOverride(SizeF availableSize)
   at Telerik.WinControls.RadElement.MeasureCore(SizeF availableSize)
   at Telerik.WinControls.RadElement.Measure(SizeF availableSize)
   at Telerik.WinControls.UI.GanttViewTextViewElement.MeasureOverride(SizeF availableSize)
   at Telerik.WinControls.RadElement.MeasureCore(SizeF availableSize)
   at Telerik.WinControls.RadElement.Measure(SizeF availableSize)
   at Telerik.WinControls.UI.RadGanttViewElement.MeasureOverride(SizeF availableSize)
   at Telerik.WinControls.RadElement.MeasureCore(SizeF availableSize)
   at Telerik.WinControls.RadElement.Measure(SizeF availableSize)
   at Telerik.WinControls.RootRadElement.MeasureOverride(SizeF availableSize)
   at Telerik.WinControls.RootRadElement.MeasureCore(SizeF availableSize)
   at Telerik.WinControls.RadElement.Measure(SizeF availableSize)
   at Telerik.WinControls.RadElementTree.PerformInnerLayout(Boolean performMeasure, Int32 x, Int32 y, Int32 width, Int32 height)
   at Telerik.WinControls.RadControl.OnLoad(Size desiredSize)
   at Telerik.WinControls.RadControl.LoadElementTree(Size desiredSize)
   at Telerik.WinControls.RadControl.OnCreateControl()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WmShowWindow(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at Telerik.WinControls.UI.RadFormControlBase.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************

Workaround: set the RadOictureBoxElement.PanelDisplayMode property to PictureBoxPanelDisplayMode.None.

0 comments