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 / Windows Forms / WinForm General / September 2004

Tip: Looking for answers? Try searching our database.

Pass DataSet to Modal Form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JD - 24 Sep 2004 19:13 GMT
I have built a main form that creates and fills a dataset.  I want to open a
modal form and pass it one of the tables in the dataset but I don't know how
to code it in VB.  Does anyone have an example or point me in the right
direction to find some code?

thanks
Sijin Joseph - 26 Sep 2004 16:12 GMT
You need to modify the constructor of the form so that it takes a
DataTable as a parameter and then pass the datatable as a parameter when
you create the modal form using new

Sijin Joseph
http://www.indiangeek.net
http://weblogs.asp.net/sjoseph

> I have built a main form that creates and fills a dataset.  I want to open a
> modal form and pass it one of the tables in the dataset but I don't know how
> to code it in VB.  Does anyone have an example or point me in the right
> direction to find some code?
>
> thanks
JD - 27 Sep 2004 18:44 GMT
Sijin,
Thanks that worked well.
Once I have passed the 'new' modal form the datatable, How do I synchornize
the modal form when the record in the main form is moved  to either "next"
or "previous" using navigation buttons?  Right now the data that shows in
the grid on the modal form is for the first record in the dataset no matter
which record shows in the main form.
jim

> You need to modify the constructor of the form so that it takes a
> DataTable as a parameter and then pass the datatable as a parameter when
[quoted text clipped - 10 lines]
>>
>> thanks
Sijin Joseph - 28 Sep 2004 07:18 GMT
Ok in this case you will also need to pass the BindingContext of the
parent form to the modal form and set the BindingContext of the Modal
form to this passed BindingContext, something like

public class ModalForm
{
    public ModalForm(BindingContext ctxt,DataTable table)
    {
        this.BindingContext = ctxt;
        ...
    }
}

Sijin Joseph
http://www.indiangeek.net
http://weblogs.asp.net/sjoseph

> Sijin,
> Thanks that worked well.
[quoted text clipped - 19 lines]
>>>
>>>thanks
JD - 29 Sep 2004 20:45 GMT
thank you

> Ok in this case you will also need to pass the BindingContext of the
> parent form to the modal form and set the BindingContext of the Modal form
[quoted text clipped - 36 lines]
>>>>
>>>>thanks

Rate this thread:







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.