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
  • 469350
    Suggested Answer
    Offline posted

    It's a little hard to tell what's happening here from your description.

    What is dt_MyTable in code snippets you listed here? Why are you changing the table name?

    Can you post the call stack of the error? The error message seems to indicate that something is asking the BindingManager for a particular child relation that does not exist.

Reply Children