Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / May 2007

Tip: Looking for answers? Try searching our database.

Q: Child list for field x cannot be created.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Martin Arvidsson, Visual Systems AB - 10 May 2007 16:40 GMT
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
Martin Arvidsson, Visual Systems AB - 10 May 2007 17:28 GMT
Well, i found the solution, it was so easy :)

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

/Martin

> Hi!
>
[quoted text clipped - 36 lines]
>
> /Martin

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.