473,809 Members | 2,625 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Get DataGridView.Se lectedRows Children Data

29 New Member
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(ShippingA ddress) 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 1313

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

Similar topics

2
4577
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 btn_Forward_Click(object sender, EventArgs e) { int movedItemCount = dg_QuestionSource.SelectedRows.Count; for (int i = 0; i < movedItemCount; i++) {
1
4168
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 of the cells in the datagridview and return it back with some other values in an object for another webservice call. The problem is I dont know how to access a cell in a datagridview to do this. Im pretty sure you have to do it thru the binding...
2
13822
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 if I select 3 rows jan feb mar Dim TmpRow As DataGridViewRow
4
34078
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 checkboxes and the rows numbers
9
2683
by: trint | last post by:
How can I retrieve all of the data from a datagridview? Any help is appreciated. Thanks, Trint
1
1835
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 OleDbDataAdapter(loadCustomer, oleDbConnectionCust); OleDbCommandBuilder commandBuilder = new OleDbCommandBuilder(dataAdapter); DataTable table = new DataTable(); dataAdapter.Fill(table);
1
3766
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 presses a button to do a SQL query (fill a DataSet). Before firing the query, I disable the grid/buttons and turn on UseWaitCursor. After it completes, I re-enable the grid/ buttons, refresh the dataset, then turn off the UseWaitCursor. If I...
2
2935
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 properties set to allow the user to edit data but not add or delete (which will be down in the program). However when I execute the ReadXML method one emtpy row is shown. The starter XML contains: <?xml version="1.0" encoding="utf-8"?>...
2
11601
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 a foreach loop on datagridview.selectedrows and change the status to printed. Now the problem is that if the datagridview is sorted by status, when the status is changed from new to printed, that row is moved from being under new to printed and all...
0
10378
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10391
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10121
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9200
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7664
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6881
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5690
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3862
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.