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.
Unfortunately, activation email could not send to your email. Please try again.

TableDescriptor.Columns.Count raise exception

Thread ID:

Created:

Updated:

Platform:

Replies:

82744 Jun 19,2009 06:08 PM Jun 29,2009 08:46 AM Windows Forms 3
loading
Tags: GridControl
Sergey Merkuriev
Asked On June 19, 2009 06:08 PM

Exception happen in following call gridGroupingControl.TableDescriptor.Columns.Count;

for(int index = 0; index < gridGroupingControl.TableDescriptor.Columns.Count; index++)
{
...
}

Exception content:

"Object reference not set to an instance of an object."

"Syncfusion.Grid.Grouping.Windows"

at Syncfusion.Windows.Forms.Grid.Grouping.GridGroupingControl.engine_SourceListChanged(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at Syncfusion.Grouping.Engine.OnSourceListChanged(EventArgs e)
at Syncfusion.Windows.Forms.Grid.Grouping.GridEngineBase.OnSourceListChanged(EventArgs e)
at Syncfusion.Grouping.Engine.SetSourceList(IEnumerable value)
at Syncfusion.Windows.Forms.Grid.Grouping.GridEngineBase.SetCurrencyManager(CurrencyManager value)
at Syncfusion.Windows.Forms.Grid.Grouping.GridEngineBase.get_CurrencyManager()
at Syncfusion.Windows.Forms.Grid.Grouping.GridEngineBase.GetSourceListBase()
at Syncfusion.Grouping.Engine.GetSourceList()
at Syncfusion.Grouping.FieldDescriptorCollection.EnsureInitialized(Boolean populate)
at Syncfusion.Grouping.FieldDescriptorCollection.get_Count()
at Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptorCollection.EnsureInitialized(Boolean populate)
at Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptorCollection.get_Count()
at OpsCenter.UI.Editor.Grid.AsbtractGridController`1.Render(Object dataSource, ICollection`1 dataProperties) in C:\Projects\Petris\Chinook\OpsCenter\v5\Trunk\OpsCenter.UI\Editor\Grid\AsbtractGridController.cs:line 714



Untitled_17f9d887.png

Lingaraj S [Syncfusion]
Replied On June 23, 2009 12:58 PM

Hi Sergey,

Thank you for your interest in Syncfusion product.

The issue might have occurred due to the improper binding of data source in GridGroupingControl. So please try using following step to bind the data source in GridGroupingControl

Refer the code below:

this.gridGroupingControl1.BeginUpdate();
this.gridGroupingControl1.TableDescriptor.Reset();
this.gridGroupingControl1.DataSource = null;
this.gridGroupingControl1.DataMember = null;
this.gridGroupingControl1.DataSource = array;
this.gridGroupingControl1.EndUpdate(true);
this.gridGroupingControl1.Refresh();


Please let me know if you have any queries.

Regards,
Lingaraj S.

Sergey Merkuriev
Replied On June 26, 2009 05:05 PM

This way I have null reference exception when all BeginUpdate.

All that happen if I try display DataTable with zero rows and columns.

Jisha Joy [Syncfusion]
Replied On June 29, 2009 08:46 AM

Hi Sergey,

It is difficult to identify the problem without seeing it in a live application. Could you please provide us a sample that shows issue or reprodcue the issue in any one of our browser sample?. So that we could analyze it further annd provide a better solution.

Thank you for using Syncfusion products.

Regards,
Jisha

CONFIRMATION

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.

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.

;