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.

Setting TableDescriptor for nested child table.

Thread ID:

Created:

Updated:

Platform:

Replies:

26759 Mar 31,2005 05:09 AM Apr 1,2005 03:11 AM Windows Forms 6
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On March 31, 2005 05:09 AM

Hi, How can i set a tabledescriptor for a nested table. I am binding a untyped Dataset to GridGroupingControl. The Dataset is filled at runtime. I can set the tabledescriptor with it''s Columns for the parent table at designtime but how can i set the tabledescriptor for the child table at designtime ? TIA, Oliver

Administrator [Syncfusion]
Replied On March 31, 2005 05:31 AM

At runtime, you can get at the child table descriptors using: GridTableDescriptor td = this.gridGroupingControl1.GetTableDescriptor("RelationNameOrTableName"); At design time, look under the TableDescriptor property. There is a collection called Relations. Adding a relation using the collection editor gives you access to the a TableDescriptor object for that related table. Is this what you need?

Administrator [Syncfusion]
Replied On March 31, 2005 07:43 AM

Ok, now how do I bind the Relation I created in design-view to the Relation i create in code with the following line : m_DataSet.Relations.Add(m_DataSet.Tables[0].Columns[Proposal.Constants.DataBase.col_MaterialNr], m_DataSet.Tables[1].Columns[Proposal.Constants.DataBase.col_MaterialNr]); Or in other words how do I use the binding i created in design-view at runtime ?

Administrator [Syncfusion]
Replied On March 31, 2005 08:04 AM

When you call dataset.Relations.Add, make sure you use the overload that lets you specify a relation name, and then make sure you pass the same string that you used in the designer. Here is a little sample that sets Appearance.AnyCell.BackColor on a child table at design time, but creates and populates the dataset at runtime. http://www.syncfusion.com/Support/user/uploads/GGC_Sample_1b94785e.zip

Administrator [Syncfusion]
Replied On March 31, 2005 09:11 AM

seems to work until i try to set the forms visibility to true. Then i get the following Output: Could not find Field with name in Teile Could not find Field with name Gesamtpreis in Teile Could not find Field with name Summe Geräte in Teile Could not find Field with name Menge in Teile Could not find Field with name Vorschlagsmenge in Teile Could not find Field with name Bestellmenge in Teile Could not find Field with name Kommentar in Teile System.IndexOutOfRangeException: Index was outside the bounds of the array. at Syncfusion.Windows.Forms.Grid.Grouping.GridTableModel.UpdateColumnWidths(Boolean force) at Syncfusion.Windows.Forms.Grid.Grouping.GridTableModel.UpdateColumnWidths() at Syncfusion.Windows.Forms.Grid.Grouping.GridTableModel.UpdateColumnWidths(Boolean force) at Syncfusion.Windows.Forms.Grid.Grouping.GridTableModel.UpdateColumnWidths() at Syncfusion.Windows.Forms.Grid.Grouping.GridTable.VisibleColumns_TotalWidthRequest(Object sender, CancelEventArgs e) at Syncfusion.Windows.Forms.Grid.Grouping.GridVisibleColumnDescriptorCollection.OnTotalWidthRequest(CancelEventArgs e) at Syncfusion.Windows.Forms.Grid.Grouping.GridVisibleColumnDescriptorCollection.get_TotalWidth() at Syncfusion.Windows.Forms.Grid.Grouping.GridTable.GetHorizontalScrollWidth(Boolean isNested) at Syncfusion.Windows.Forms.Grid.Grouping.GridTable.GetHorizontalScrollWidth() at Syncfusion.Windows.Forms.Grid.Grouping.GridTableControl.GetHorizontalScrollWidth() at Syncfusion.Windows.Forms.Grid.Grouping.GridTableControl.SynchronizeGridWithEngine() An unhandled exception of type ''System.IndexOutOfRangeException'' occurred in syncfusion.grid.grouping.windows.dll Additional information: Index was outside the bounds of the array. catched at Syncfusion.Windows.Forms.Grid.Grouping.GridTableControl.SynchronizeGridWithEngine() in :line 0 Could not find Field with name in Teile Could not find Field with name Gesamtpreis in Teile Could not find Field with name Summe Geräte in Teile Could not find Field with name Menge in Teile Could not find Field with name Vorschlagsmenge in Teile Could not find Field with name Bestellmenge in Teile Could not find Field with name Kommentar in Teile Any suggestions ? Regards

Administrator [Syncfusion]
Replied On March 31, 2005 10:28 AM

It sounds like you have not initialized the dataset by the time the grid is trying to draw the schema information you provided in the designer. In the sample I attached earlier, the dataset was initialized in the form.load before the grid was drawn. If you want to draw the grid first, and then populate the dataset, then you will have to populate the Columns collections for both the parent and child tables in teh designer. Additionally, in form.Load, you may have to add a set ot RelationKeys that specify the relation. Here is the sample with a button that populates the dataset from a button handler after the form has been loaded. http://www.syncfusion.com/Support/user/uploads/uninitialzednestedtable_72ef9381.zip

Administrator [Syncfusion]
Replied On April 1, 2005 03:11 AM

Perfect, seems like the following line did the trick: Syncfusion.Grouping.Engine.ThrowExceptionIfSourceListSetEntryNotFound = false; thanks for your help

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.

;