Declined
Last Updated: 16 Feb 2024 19:51 by ADMIN
Lior
Created on: 12 Jan 2020 09:21
Category: GridView
Type: Bug Report
0
RadGridView exception

i am getting a null reference exception with the following call stack:

 

Description: The process was terminated due to an unhandled exception.

Exception Info: System.NullReferenceException

   at Telerik.WinControls.UI.TableViewRowLayoutBase.GetRowHeight(Telerik.WinControls.UI.GridViewRowInfo)

   at Telerik.WinControls.UI.RowElementProvider.GetElementSize(Telerik.WinControls.UI.GridViewRowInfo)

   at Telerik.WinControls.UI.ItemScroller`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].GetScrollHeight(System.__Canon)

   at Telerik.WinControls.UI.ItemScroller`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].ScrollDown(Int32)

   at Telerik.WinControls.UI.ItemScroller`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].ScrollTo(Int32)

   at Telerik.WinControls.UI.ItemScroller`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].scrollbar_ValueChanged(System.Object, System.EventArgs)

   at Telerik.WinControls.UI.RadScrollBarElement.OnValueChanged(Int32, Int32)

   at Telerik.WinControls.UI.RadScrollBarElement.set_Value(Int32)

   at Telerik.WinControls.UI.ItemScroller`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].UpdateScrollValue()

   at Telerik.WinControls.UI.ItemScroller`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].UpdateScrollRange()

   at Telerik.WinControls.UI.RowScroller.UpdateScrollRange()

   at Telerik.WinControls.UI.GridTableElement.UpdateNoDataText()

   at Telerik.WinControls.UI.GridTableElement.UpdateAll()

   at Telerik.WinControls.UI.GridTableElement.UpdateViewCore(System.Object, Telerik.WinControls.UI.DataViewChangedEventArgs)

   at Telerik.WinControls.UI.GridTableElement.UpdateView(System.Object, Telerik.WinControls.UI.DataViewChangedEventArgs)

   at Telerik.WinControls.UI.GridTableElement.ProcessTemplateEvent(Telerik.WinControls.UI.GridViewEvent)

   at Telerik.WinControls.UI.GridTableElement.Telerik.WinControls.UI.IGridViewEventListener.ProcessEvent(Telerik.WinControls.UI.GridViewEvent)

   at Telerik.WinControls.UI.GridViewEventProcessEntity.ProcessCollection(Telerik.WinControls.UI.GridViewEvent, Telerik.WinControls.UI.PriorityWeakReferenceList, Telerik.WinControls.UI.GridEventProcessMode)

   at Telerik.WinControls.UI.GridViewEventProcessEntity.ProcessEvent(Telerik.WinControls.UI.GridViewEvent)

   at Telerik.WinControls.UI.GridViewSynchronizationService.NotifyListeners(Telerik.WinControls.UI.GridViewEvent)

   at Telerik.WinControls.UI.GridViewSynchronizationService.FlushEvents()

   at Telerik.WinControls.UI.GridViewSynchronizationService.DispatchEvent(Telerik.WinControls.UI.GridViewEvent)

   at Telerik.WinControls.UI.GridViewSynchronizationService.DispatchEvent(Telerik.WinControls.UI.GridViewTemplate, Telerik.WinControls.UI.GridViewEvent, Boolean)

   at Telerik.WinControls.UI.GridViewTemplate.DispatchEvent(Telerik.WinControls.UI.GridViewEvent, Boolean)

   at Telerik.WinControls.UI.GridViewTemplate.DispatchDataViewChangedEvent(System.Object, Telerik.WinControls.UI.DataViewChangedEventArgs)

   at Telerik.WinControls.UI.GridViewTemplate.OnViewChanged(System.Object, Telerik.WinControls.UI.DataViewChangedEventArgs)

   at Telerik.WinControls.UI.MasterGridViewTemplate.OnViewChanged(System.Object, Telerik.WinControls.UI.DataViewChangedEventArgs)

   at Telerik.WinControls.UI.GridViewTemplate.EndUpdate(Boolean, Telerik.WinControls.UI.DataViewChangedEventArgs)

   at Telerik.WinControls.UI.MasterGridViewTemplate.EndUpdate(Boolean, Telerik.WinControls.UI.DataViewChangedEventArgs)

   at Telerik.WinControls.UI.GridViewTemplate.set_RowCount(Int32)

   at Telerik.WinControls.UI.RadGridView.set_RowCount(Int32)

   at Communication_Logger.frmCommunicationLogger.RadRibbonForm1_OnDataReceived(Communication_Logger.Data)

   at Communication_Logger.ChannelClass.Serial_DataReceived(System.Object, System.IO.Ports.SerialDataReceivedEventArgs)

   at System.IO.Ports.SerialPort.CatchReceivedEvents(System.Object, System.IO.Ports.SerialDataReceivedEventArgs)

   at System.IO.Ports.SerialStream+EventLoopRunner.CallReceiveEvents(System.Object)

   at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(System.Object)

   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)

   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)

   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()

   at System.Threading.ThreadPoolWorkQueue.Dispatch()

   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

 

the setup is a dotNet 4.5.2 winforms application with RadGridView in virtual mode.

The exception occur when the application is left working for days (2 in this case) without any user interaction.

The application normally updates a list that is used by the gridview, the list records are added and removed continuously, the grid view RowCount is updated via a timer.

i suspect that the RowCount reported at one point in time doesn't match the list size as it is trimmed, and therfore the GetRowHeight fails as the data doesn't exist - can this be handled in the gridview - to avoid a termination of the process due to the exception ?

 

regards,

guy.

 

2 comments
ADMIN
Dinko | Tech Support Engineer
Posted on: 16 Feb 2024 19:51

Hi Guy,

The feedback item status is changed to Declined due to inactivity.

Regards,
Dinko | Tech Support Engineer
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 17 Jan 2020 11:40

Hello, Guy,    

The provided stack trace is greatly appreciated. However, it is not enough for me to replicate the issue locally and determine what causes the issue on your end. It seems that the error occurs in the TableViewRowLayout which can't be accessed via external code and manipulate the GetRowHeight method.

Would it be possible to provide a sample runnable project demonstrating the error you are facing? Thus, we would be able to replicate the issue locally, make an adequate analysis of he precise case and assist you further. Thank you in advance.

Currently, the possible solution that I can suggest is instead of using RadGridView with virtual mode, feel free to use RadVirtualGrid. It is a grid component developed on top of Telerik Presentation Framework which provides a convenient way to implement your own data management operations and optimizes the performance when interacting with large amounts of data. Additional information how to populate RadVirtualGrid with data is available in the following help articles: 
https://docs.telerik.com/devtools/winforms/controls/virtualgrid/overview 
https://docs.telerik.com/devtools/winforms/controls/virtualgrid/working-with-data/virtualgrid-populating-with-data 

I am looking forward to your reply.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.