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.

Binding grid to some other Dataset

Thread ID:





16458 Jul 15,2004 11:38 AM Jul 15,2004 01:18 PM Windows Forms 5
Tags: GridControl
Asked On July 15, 2004 11:38 AM

I am binding a DataBoundGrid to a Dataset with two tables.On some event I want to bind the grid to some other DataTable.Want to display some other data not the previous one. I wrote following code on that event which generated exception. this.gridDataBoundGrid1.DataMember = "Messages"; this.gridDataBoundGrid1.DataSource = messageTable; (messageTable is DataTable) The exception was Cannot create a child list for field Messages. How to handle this?

Administrator [Syncfusion]
Replied On July 15, 2004 11:56 AM

Try switching the order of the two statements. this.gridDataBoundGrid1.DataSource = MessageTable; this.gridDataBoundGrid1.DataMember = "Messages"; If that does not do it, then add this code first. this.gridDataBoundGrid1.DataSource = null; this.gridDataBoundGrid1.DataMember = "";

Replied On July 15, 2004 12:04 PM

Hi Clay, Thanks for your quick responses. The problem is still there. Even I tried DataMember = Null; Umangi

Administrator [Syncfusion]
Replied On July 15, 2004 12:11 PM

If you are setting DataSource to a DataTable (messageTable), then the only reason to set DataMember = "Messages" is if "Messages" is a name of a DataRelation that you want to see in a hierarchical grid. Is this the case? If not, then DataMember should just be set to "".

Replied On July 15, 2004 12:57 PM

This does not generate exception but only first column is displayed. And when I try to bind with original data I write following code. this.gridDataBoundGrid1.DataMember = "QueryThreads"; this.gridDataBoundGrid1.DataSource = dataSet; GridHierarchyLevel queryLevel = this.gridDataBoundGrid1.Binder.AddRelation("QueryThreadQuery"); Now the following exception is generated ''Cannot create a child list for field QueryThreads.'' Clay, Can u help me?

Replied On July 15, 2004 01:18 PM

I did DataMember = ""; DataSource = dataSet; And It''s working! Sorry for the trouble


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.