Page 1 of 1
Is there any way to manage a dataset inside of a child form?
Posted: Mon 16 Jun 2008 08:14
by manuel.romero
Hello everybody!
I have a little question, maybe for you is trivial but I couldn't discover how to make update, fill or clear of a dataset from a form which is child of the form which has the dataset.
I have tried to put the dataset as static, in that it works but when I exit from the project and enter again I have lots of warnings from all the datalinks complaining because they can't find the dataset.
Any another solution?
Thanks a lots for your help. Regards,
Manuel J. Romero
Posted: Tue 17 Jun 2008 10:13
by Alexey.mdr
Hello Manuel,
Try setting the Modifiers property of the DataSet instance on the form (e.g. DataSet1)
to public. This should solve the problem.
Regards,
Alexey.
Posted: Tue 17 Jun 2008 10:38
by manuel.romero
Hi!
Let's see how can I access to a parent variable from the child if I don't have the reference of the parent? For example I have:
A parent form named parentForm with a public dataset named dataset1, if I call that form from another form I should make:
parentForm pF = new parentForm();
and now I could make pF.dataset1.Fill();
But from a child I don't have pF because this is the called form. At the moment I could access putting the dataset like static and from the child:
parentForm.dataset1.Fill()
What am I making wrong?
Thanks a lots for your help.
Posted: Wed 18 Jun 2008 08:27
by Alexey.mdr
Hello,
I have sent you a sample project.
Please let me know if I should resend it.
Regards,
Alexey.
Posted: Wed 18 Jun 2008 10:06
by manuel.romero
Thanks a lots for your example!
But in my case, my project is different because I'm using a form with the dataset and UserControls which I added to the form to create pages. So when I said child forms I wanted to say the child pages. And I can't inherit from the form because they are different classes.
At the moment I'm sending the dataset in the constructor of the pages, and when I make a clear or a fill operation it worksright because the objects, which use the "parent" dataset, update their contents at the same time when I refill the dataset in the child page.
Is this a good solution?
Thanks a lots for your help.
Posted: Wed 18 Jun 2008 15:55
by Alexey.mdr
Hello,
Is it a WinForms application or an ASP.NET one?
Could you please make a small test project and send it to me (alexeyman*devart*com)?
Regards,
Alexey.
Posted: Thu 19 Jun 2008 10:30
by manuel.romero
Hi!
I have sent a test project to your email. And it's a winform application.
Regards,
Manuel Romero
Posted: Thu 19 Jun 2008 10:47
by Alexey.mdr
Hello Manuel,
Thank you for the inquiry.
I have received the project.
I will contact you in the nearest time.
Regards,
Alexey.