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 Data Binding / October 2004

Tip: Looking for answers? Try searching our database.

WinForm DataBinding Blues

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Wayne Van Rooyen - 06 Oct 2004 14:36 GMT
I know this is most probably a regular question but after searching and
searching and purchasing over 5 books, i still have not found a simple
sample. If someone could please oblidge i would really apreciate it.

If the sample could do/have the following

Form 1:
DataSet bound to NorthWind Products and a grid bound to that.
User will double click the grid and it will open Form 2 . Form 2 to be as
follows

Form 2
Edit controls ie: text / combos bound to a DataSet -> NorthWind Products
Once the user has double clicked the grid from Form 1, Form 2 will open Modal
at the correct record location ready for editing.

Also on Form 1 user can Add Delete and Edit by clicking on the relevant
buttons and displaying the Form 2 in the correct mode.

This has been a very frustrating task for me and i cant believe every book
shows how to edit data right from the Datagrid, yet most real world apps dont
work like that.

Once again anyone willing to help me out here.
Many Thanks
Wayne
Beverley - 06 Oct 2004 17:40 GMT
I'm pretty sure the book I had out from the library had samples that did just what you're
looking for.

It was "Murach's VB.Net Database Programming with ADO.Net" and was very well written.  You
might want to see if your library has it before you buy yet another book :)

Beverley

> I know this is most probably a regular question but after searching and
> searching and purchasing over 5 books, i still have not found a simple
[quoted text clipped - 22 lines]
> Many Thanks
> Wayne
Sijin Joseph - 07 Oct 2004 04:52 GMT
Let me try and give you a brief outline of the steps you need to do

1. Binding a dataset to a datagrid is easy and you will find a lot of
samples for that, just set the datasource and datamember props of the
datagrid

2. Determine the row that was clicked on the datagrid, you can use
DataGrid.HitTest() method for this.

3. Extract the DataRowView corresponding to the selected row and pass it
to your form. The form then edits the values in this row.

These are the basic pieces you will need to put in place to do what you
want to do..

Let me know if you get stuck somewhere..

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

> I know this is most probably a regular question but after searching and
> searching and purchasing over 5 books, i still have not found a simple
[quoted text clipped - 22 lines]
> Many Thanks
> Wayne
Steve Alpert - 07 Oct 2004 17:59 GMT
Another option... per a recent article by Dino Esposito.
The issue is that the Binding collection on the second form has no
connection to the binding collection on the first form.

Do something like:
1.  instantiate the 2nd form
2.  call a method on it to pass the datasource and some binding info
from the first form
3.  in the OnLoad event of the 2nd form, perform the binding on its
controls.

/steveA

> I know this is most probably a regular question but after searching and
> searching and purchasing over 5 books, i still have not found a simple
[quoted text clipped - 22 lines]
> Many Thanks
> Wayne

Signature

Steve Alpert
my email Fgrir_Nycreg @ vqk.pbz is encrypted with ROT13 (www.rot13.org)
and spaces


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.