473,405 Members | 2,279 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Get DataGridView.SelectedRows Children Data

29
Hi All,

I have a datagridview, and I'm looping threw the selected rows like so:

Expand|Select|Wrap|Line Numbers
  1. For Each row As System.Windows.Forms.DataGridViewRow In OrderDataGridView.SelectedRows
This DataGridView Holds Order Information and it contains a column called ShippingID, which is used as a foreign key relation to another table(ShippingAddress) in the DataSet.

My question is how to I access the related ShippingAddress data? Basically I want to do something like this:

Expand|Select|Wrap|Line Numbers
  1. For Each row As System.Windows.Forms.DataGridViewRow In OrderDataGridView.SelectedRows
  2.  
  3. OrderdID = row.cells(1)
  4. ShippingAddress1 = row.relatedtable.item("ShippingAddress1")
  5.  
  6. Next
  7.  
Thanks
Chad
Jun 30 '09 #1
0 1303

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Ye Li | last post by:
I have two windows with datagridview control type in one form. I want to move multiple rows from one datagridview to another datagridview. My code is as follows: private void...
1
by: Riley | last post by:
Need some help. I am using datagridview in 2005 with C#. I am calling a web service and filling the datagridview with the data returned. This all works fine. Next step is to take a value from one...
2
by: Nickneem | last post by:
I'm trying to figure out the datagridview, but I'm having trouble stepping through the selectedrows because the first row I get is the last row selected (with the heighest index). For instance...
4
by: Annie | last post by:
hello guys, I am having a DataGridView control. The first column is a checkbox column. The users can select the checkbox column. I need to loop through the grid rows and get the checked...
9
by: trint | last post by:
How can I retrieve all of the data from a datagridview? Any help is appreciated. Thanks, Trint
1
by: jed | last post by:
Hello i need help on this i have read data into a gridview using sql statement. string loadCustomer = "SELECT * FROM Customers"; OleDbDataAdapter dataAdapter = new...
1
by: Aegixx | last post by:
Ok, extremely wierd situation here: (I'll post the code below, after the explanation) I've got a Windows application (.NET 3.5) that has a single Form with a DataGridView embedded. The user...
2
by: Stewart Berman | last post by:
I have an application that populates a DataGridView control with an XML. file. 1. How do I set up the process so the user initally sees just the headers -- no records. I have the DataGridView...
2
by: cday119 | last post by:
Hi Everyone, So I have a datagridview and it has a column called status. It has 3 values: New, Printed, and Shipped. Now a user can select multiple rows and click "set to printed". I then do...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.