Q: Child list for field x cannot be created.

  • Thread starter Thread starter Martin Arvidsson, Visual Systems AB
  • Start date Start date
M

Martin Arvidsson, Visual Systems AB

Hi!

Have a little problem when i want to use the other dataset with the same
grid.

When i display the form i use the UniqueFolders. All works fine, then click
a button
and send InitializeGrid with FileDeletion as parameter and the exception is
raised. (See subject)

What to do? Do i have to clear the datagridview with some method or what?

This is my code:

void InitializeGrid(EGridInitialize gridInitialize)
{
switch (gridInitialize)
{
case EGridInitialize.UniqueFolders:
this.dataGridView1.DataMember =
DataSetUniqueFolders.Tables[0].TableName;
this.dataGridView1.DataSource = DataSetUniqueFolders;
this.dataGridView1.Columns[0].HeaderText = "Compare/Delete";
this.dataGridView1.Columns[1].HeaderText = "Project Path";
break;
case EGridInitialize.FileDeletion:
this.dataGridView1.DataMember =
DataSetUnusedFiles.Tables[0].TableName;
this.dataGridView1.DataSource = DataSetUnusedFiles; ;
this.dataGridView1.Columns[0].HeaderText = "/Delete";
this.dataGridView1.Columns[1].HeaderText = "File";
this.dataGridView1.Columns[2].HeaderText = "Complete path and file";
break;
default:
break;
}
}

/Martin
 
Well, i found the solution, it was so easy :)

I set the DataMember and DataSource to null before i reinitialized again...

/Martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top