Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
155
Child list for field TableName cannot be created.
posted

I have a windows application. When I select the option one from a combo-box, I bind an UltraGrid control to a DataSet with to DataTables (Maestro and Detalle) and a Relation between them:

    ds_MaestroDetalle.Relations.Add(
                    "Maestro_Detalle",
                    ds_MaestroDetalle.Tables["Maestro"].Columns["ID"],
                    ds_MaestroDetalle.Tables["Detalle"].Columns["ID"]);

Since I want to Export to Excel the info in the two DataTables and the relationship, I use SetDataBindings:

    this.ug_Reportes.SetDataBinding(ds_MaestroDetalle, "Maestro");

Then, when I select the option two from the combo-box, I bind the same
Ultragrid to a DataTable.

    dt_MyTable.TableName = "Maestro";
    this.ug_Reportes.DataSource = dt_MyTable;

I get the following message when binding to the second option:  "Child list for field Maestro cannot be created."

I guess, when binding to the DataTable in the second option, UltraGrid is currently looking for Table Maestro in the DataSet (first option).

I try to UltraGrid.DataBindings.Clear(), UltraGrid.DataSource = null, but I don't know how to reset UltraGrid to start binding again without problems.


Thanks in advanced!

Parents
No Data
Reply
  • 9298
    posted

    The problem seems to be that the DataMember is still looking for the table in the previous datasource.  I believe you should call the SetDataBinding method again and set the DataSource and DataMember in one operation.  Let me know if that works.

    Michael S.

Children