Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Child List for field xxx cannot be created for DataGridV
Message
From
09/07/2010 10:24:02
Jeff Corder
Ambit Technologies, LLC
Missouri, United States
 
 
To
09/07/2010 08:18:07
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01471928
Message ID:
01471988
Views:
31
Here's the sequence of events that causes the problems:

AutoEmptyOnParentAdded = true (I've tried this with other child objects and it's consistent)

When ParentBizObj.NewRow() is called, the execution path includes:

mmBusinessObjectGeneric.StateChangeHandler(mmBaseBusinessObject bizObj, mmBusinessStateChangeEventArgs e)
When AutoEmptyOnParentAdded = true, GetEmptyEntityList() is called.

BusinessObjectHelperDS.GetEmptyEntityList[EntityType](string databaseKey, mmBusinessObjectGeneric[EntityType] businessObject)
When it calls GetEmptyDataSet(), it passes null for the dataset instead of the businessobject.DataSet - probably a very good reason.

mmBusinessObject.GetEmptyDataSet(DataSet ds, string tableName, string databaseKey)
When a null dataset is passed, the following code executes

ds = this.CreateDataSet();
this.SetCurrentDataSet(ds, tableName);

Thus, SetCurrentDataSet() is called without any DataTables defined. Later in GetEmptyDataSet(), GetEmptyDataTable() is called to create the DataTable, THEN SetCurrentDataSet() is called with a defined DataTable. It looks like the first call to SetCurrentDataSet() is an error and should be removed. I may be wrong (wouldn't be the first time, you can ask Kevin), but I don't see any scenarios where SetCurrentDataSet() belongs here.

mmBusinessObject.SetCurrentDataSet(DataSet ds, string tableName, bool setRequiredFields, bool raiseEvents, int rowNumber)
Executes and attempts to call CallStateChange() which calls...

mmBindingStrategyDataGrid.BindData(ImmBindingDataGrid mmGrid, DataSet ds, string tableName, mmBusinessObject bizObj)
which throws an error when setting the GridView.DataMember = tableName which is a table that does not exist in the dataset.



Answers to your questions:

I'm using WinForms.

oSalesDocument refers to a business object that is a composite of several business objects. The goal was to create a Business Document that contained the invoice, invoice items, customer... and all related information so I could combine the Business Logic to deal with a business document in one place. oSalesDocument.Invoices references the Invoices business object of the sales document.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform