We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to display empty gridgroupingcontrol

Thread ID:





79918 Mar 4,2009 10:06 AM UTC May 1,2009 02:19 PM UTC WinForms 7
Tags: Grouping
Prabakaran K
Asked On March 4, 2009 10:06 AM UTC

I need to display empty gridgrouping control.

When I assign like below:

this.plangrid.DataSource = string.Empty;

I am getting error message as, "BadDataSourceForComplexBinding".

Please anyone knows, help me ASAP.


Rajadurai C [Syncfusion]
Replied On March 5, 2009 01:32 PM UTC

Hi Prabakaran,

Thanks for your interest in Syncfusion products.

A gridgroupingcontrol cannot display data without binding it to a datasource. The tabledescriptor must be set with columns and rows. If you would like to display an empty grid, you can bind it to a datasource containing layout for rows and columns(column name) but with no data.

Please let me know if you have any further concerns.


Administrator [Syncfusion]
Replied On March 12, 2009 01:17 PM UTC


I am getting the below error, when i ExpandAllRecords in the GCC.

Failed to compare two elements in the array.

Please help me..


Rajadurai C [Syncfusion]
Replied On March 14, 2009 07:48 AM UTC

Hi Praba,

The following code expands all the records without throwing any exception


From your update, it seems that you are handling some condition to expand records. If yes, please provide the code which is throwing exception and the events handled, if any.


Administrator [Syncfusion]
Replied On April 29, 2009 07:09 AM UTC


I have condition like:

If(grdgroupcontrol.Table != null)

How do i find how many tables grouped into this groupingcontrol?


>Hi Praba,

The following code expands all the records without throwing any exception


From your update, it seems that you are handling some condition to expand records. If yes, please provide the code which is throwing exception and the events handled, if any.


Administrator [Syncfusion]
Replied On April 29, 2009 08:14 AM UTC


I am getting the below Exception error.

An exception of type 'System.NullReferenceException' occurred and was caught.

04/29/2009 09:01:13
Type : System.NullReferenceException, mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089
Message : Object reference not set to an instance of an object.
Source : Syncfusion.Grouping.Base
Help link :
Data : System.Collections.ListDictionaryInternal
TargetSite :
Stack Trace : at Syncfusion.Grouping.Table.InitUnsortedRecords(Boolean forceParentElement)
at Syncfusion.Grouping.Table.CategorizeElements()
at Syncfusion.Grouping.Table.OnEnsureInitialized(Object sender)
at Syncfusion.Grouping.Element.EnsureInitialized(Object sender, Boolean notifyParent)
at Syncfusion.Grouping.Table.BaseEnsureInitialized(Object sender, Boolean notifyParent)
at Syncfusion.Grouping.Table.EnsureInitialized(Object sender, Boolean notifyParent)
at Syncfusion.Grouping.Table.get_FilteredChildTableOrTopLevelGroup()
at Syncfusion.Windows.Forms.Grid.Grouping.GridNestedTableControl.get_CurrentCell()
at Syncfusion.Windows.Forms.Grid.Grouping.GridTableControl.DeactivateCurrentCell(Boolean allowCancel)
at Syncfusion.Windows.Forms.Grid.Grouping.GridTableControl.Table_DisplayElementChanging(Object sender, DisplayElementChangingEventArgs e)
at Syncfusion.Windows.Forms.Grid.Grouping.GridTableModel.OnDisplayElementChanging(DisplayElementChangingEventArgs e)
at Syncfusion.Windows.Forms.Grid.Grouping.GridTableModel.Syncfusion.Grouping.ITableEventsTarget.OnDisplayElementChanging(DisplayElementChangingEventArgs e)
at Syncfusion.Grouping.TableDescriptor.Syncfusion.Grouping.ITableEventsTarget.OnDisplayElementChanging(DisplayElementChangingEventArgs e)
at Syncfusion.Grouping.Table.OnDisplayElementChanging(DisplayElementChangingEventArgs e)
at Syncfusion.Grouping.Table.Engine_PropertyChanging(Object sender, DescriptorPropertyChangedEventArgs e)
at Syncfusion.Windows.Forms.Grid.Grouping.GridTable.Engine_PropertyChanging(Object sender, DescriptorPropertyChangedEventArgs e)
at Syncfusion.Grouping.DescriptorPropertyChangedEventHandler.Invoke(Object sender, DescriptorPropertyChangedEventArgs e)
at Syncfusion.Grouping.Engine.OnPropertyChanging(DescriptorPropertyChangedEventArgs e)
at Syncfusion.Windows.Forms.Grid.Grouping.GridEngine.Syncfusion.Windows.Forms.Grid.Grouping.IGridTableOptionsSource.RaiseTableOptionsChanging(GridTableOptionsChangedEventArgs e)
at Syncfusion.Windows.Forms.Grid.Grouping.GridTableOptionsStyleInfoIdentity.OnStyleChanging(StyleInfoBase style, StyleInfoProperty sip)
at Syncfusion.Styles.StyleInfoBase.OnStyleChanging(StyleInfoProperty sip)
at Syncfusion.Styles.StyleInfoBase.SetValue(StyleInfoProperty sip, Object value)
at Syncfusion.Windows.Forms.Grid.Grouping.GridTableOptionsStyleInfo.set_AllowSelection(GridSelectionFlags value)
at GM.UI.SmartParts.RangePlan.RangePlanGrid.SetFirstRecordSelected()

Please help me to resolve this.

I trying to setfirstrecord selected after collapse all the records in the grid.

Is it possible?


Administrator [Syncfusion]
Replied On April 29, 2009 09:21 AM UTC


First time, i have loaded some 50 records and i have done some modifications and saved those records into database.

Then, I am trying load some 150 records, but its loading only 50 records which is filteredrecord count set by previously loaded record count.

How can i clear the filteredrecord count at each time loading data into GCC?


Lingaraj S [Syncfusion]
Replied On May 1, 2009 02:19 PM UTC

Hi Prabha,

Thank you for your update.

The GridGroupingControl does not have default property to get the number of related tables. If you want to get the number of tables in GridGroupingControl, please try using RelatedTable property in iterate loop to get the number of tables.
Please refer the code below:

bool flag = true;
int count1=0;
Table tab=this.hierarchyGrid.Table;
while (flag)
if (tab != null)
if (tab.RelatedTables.Count != 0)
tab = tab.RelatedTables[0];
flag = false;
flag = false;

If you reload the data in GridGroupingControl, please try to set the DataSource property to null before the rebinding to avoid this issue.
Please refer the rebinding code below:

this.gridGroupingControl1.DataSource = null;
this.gridGroupingControl1.DataMember = null;
this.gridGroupingControl1.DataSource = newdatasource;

Let me know if it helps.

Lingaraj S.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon