Radgridview Grouping Causing Exception

1 Answer 23 Views
GridView
harsha
Top achievements
Rank 1
harsha asked on 29 Apr 2022, 07:02 AM

Hi,

   I tried Telerik Radgridview Grouping using example in docs.telerik.com/devtools/winforms/controls/gridview/grouping/setting-groups-programmatically. But when ever i tried to group its showing Object not set to instance of  an Object error.

 

My input data looks like this

 

 

My Group descriptor code looks like this

My Error looks like this

 

I am not sure why i am getting this error. I just wanted to group the data by DevelopmentPart.

 

And also if you have any small sample project for gridview can you provide?

 

Regards

Harsha

1 Answer, 1 is accepted

Sort by
0
Accepted
Dess | Tech Support Engineer, Principal
Telerik team
answered on 29 Apr 2022, 08:37 AM
Hello, Harsha,   

I am really sorry to hear that you are experiencing any difficulties with the Telerik Ui for WinForms suite. However, following the provided information, I was unable to reproduce the issue you are facing. I have attached my sample project. Please give it a try and see how it works on your end. Am I missing something? Could you please specify the exact steps how to reproduce the problem? Feel free to modify the project in a way to reproduce the experienced issue and get back to me with it so I can investigate the precise case. Thank you in advance. 

I am looking forward to your reply.

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

harsha
Top achievements
Rank 1
commented on 29 Apr 2022, 09:15 AM

Hi Dess,

    Thanks for the quick reply. I am getting group working as expected from your sample project but still fails in mine. I cant figure out why.

I am trying the grouping on VB project... Does that has any impact.

 

I am posting my stacktrace. Can you please look at it and guide me?

 

   at System.RuntimeMethodHandle._InvokeConstructor(Object[] args, SignatureStruct& signature, IntPtr declaringType)
   at System.RuntimeMethodHandle.InvokeConstructor(Object[] args, SignatureStruct signature, RuntimeTypeHandle declaringType)
   at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at Telerik.WinControls.UI.GridRowElement.CreateCell(GridViewColumn column)
   at Telerik.WinControls.UI.GridGroupHeaderRowElement.Initialize(GridViewRowInfo rowInfo)
   at Telerik.WinControls.UI.GridRowElement.Attach(GridViewRowInfo row, Object context)
   at Telerik.WinControls.UI.BaseVirtualizedContainer`1.InsertElement(Int32 position, IVirtualizedElement`1 element, T data)
   at Telerik.WinControls.UI.BaseVirtualizedContainer`1.UpdateElement(Int32 position, T data)
   at Telerik.WinControls.UI.ScrollableRowsContainerElement.UpdateElement(Int32 position, GridViewRowInfo data)
   at Telerik.WinControls.UI.BaseVirtualizedContainer`1.MeasureElements()
   at Telerik.WinControls.UI.BaseVirtualizedContainer`1.MeasureOverride(SizeF availableSize)
   at Telerik.WinControls.UI.ScrollableRowsContainerElement.MeasureOverride(SizeF availableSize)
   at Telerik.WinControls.RadElement.MeasureCore(SizeF availableSize)
   at Telerik.WinControls.RadElement.Measure(SizeF availableSize)
   at Telerik.WinControls.UI.RowsContainerElement.MeasureOverride(SizeF availableSize)
   at Telerik.WinControls.RadElement.MeasureCore(SizeF availableSize)
   at Telerik.WinControls.RadElement.Measure(SizeF availableSize)
   at Telerik.WinControls.Layouts.ContextLayoutManager.UpdateLayout()
   at Telerik.WinControls.RadElement.UpdateLayout()
   at Telerik.WinControls.UI.GridTableElement.UpdateWhenGroupingChanged()
   at Telerik.WinControls.UI.GridTableElement.UpdateViewCore(Object sender, DataViewChangedEventArgs args)
   at Telerik.WinControls.UI.GridTableElement.UpdateView(Object sender, DataViewChangedEventArgs args)
   at Telerik.WinControls.UI.GridTableElement.ProcessTemplateEvent(GridViewEvent eventData)
   at Telerik.WinControls.UI.GridTableElement.Telerik.WinControls.UI.IGridViewEventListener.ProcessEvent(GridViewEvent eventData)
   at Telerik.WinControls.UI.GridViewEventProcessEntity.ProcessCollection(GridViewEvent gridEvent, PriorityWeakReferenceList list, GridEventProcessMode processMode)
   at Telerik.WinControls.UI.GridViewEventProcessEntity.ProcessEvent(GridViewEvent gridEvent)
   at Telerik.WinControls.UI.GridViewSynchronizationService.NotifyListeners(GridViewEvent gridEvent)
   at Telerik.WinControls.UI.GridViewSynchronizationService.FlushEvents()
   at Telerik.WinControls.UI.GridViewSynchronizationService.DispatchEvent(GridViewEvent gridEvent)
   at Telerik.WinControls.UI.GridViewSynchronizationService.DispatchEvent(GridViewTemplate template, GridViewEvent eventData, Boolean postUI)
   at Telerik.WinControls.UI.GridViewTemplate.DispatchEvent(GridViewEvent gridEvent, Boolean postUI)
   at Telerik.WinControls.UI.GridViewTemplate.DispatchDataViewChangedEvent(Object sender, DataViewChangedEventArgs args)
   at Telerik.WinControls.UI.GridViewTemplate.OnViewChanged(Object sender, DataViewChangedEventArgs e)
   at Telerik.WinControls.UI.MasterGridViewTemplate.OnViewChanged(Object sender, DataViewChangedEventArgs e)
   at Telerik.WinControls.UI.GridViewTemplate.CollectionView_CollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
   at Telerik.WinControls.Data.RadCollectionView`1.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
   at Telerik.WinControls.Data.RadDataView`1.RebuildData(Boolean notify)
   at Telerik.WinControls.Data.RadDataView`1.RefreshOverride()
   at Telerik.WinControls.Data.RadDataView`1.OnNotifyPropertyChanged(PropertyChangedEventArgs e)
   at Telerik.WinControls.Data.RadCollectionView`1.OnNotifyPropertyChanged(String propertyName)
   at Telerik.WinControls.Data.RadCollectionView`1.groupDescriptors_CollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
   at Telerik.Collections.Generic.NotifyCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
   at Telerik.WinControls.UI.GridViewGroupDescriptorCollection.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
   at Telerik.Collections.Generic.NotifyCollection`1.InsertItem(Int32 index, T item)
   at Telerik.WinControls.Data.GroupDescriptorCollection.InsertItem(Int32 index, GroupDescriptor item)
   at Telerik.WinControls.UI.GridViewGroupDescriptorCollection.InsertItem(Int32 index, GroupDescriptor item)
   at System.Collections.ObjectModel.Collection`1.Add(T item)
   at K2BMS.frmEditDevForecast.SetDataTableCloumns(DataTable dt) in C:\TFS\Development\K2Development\K2BMS-LTTS\frmEditDevForecast.vb:line 232
harsha
Top achievements
Rank 1
commented on 29 Apr 2022, 09:32 AM

HI Dess,

   I am also data source for that gridview.

 

I am grouping on DevelopmentPart.

Regards

Harsha D

 

harsha
Top achievements
Rank 1
commented on 02 May 2022, 04:28 AM

Hi Dess,

   I finally found out where was the issue. I had few things in Group summary evaluate which was causing the issue since grouping hits that event in load. Thanks for the support and sorry for the inconvenience.

 

Regards

Harsha D 

 

Dess | Tech Support Engineer, Principal
Telerik team
commented on 02 May 2022, 05:44 AM

Hi, Harsha,

I am glad to hear that the problem you were facing is now resolved. Indeed, the GroupSummaryEvaluate is expected to be fired as it allows to modify the header text of the group rows. Should you have further questions please let me know.

Tags
GridView
Asked by
harsha
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or