|
-
Oct 17th, 2007, 11:51 AM
#1
Thread Starter
Lively Member
DataGridView usage
Ok all/ Please help me save my head, and the wall. I have been searching and testing for three weeks to achieve 2 functions with the DataGridView.
Function 1:
I have a form with a DataGridView, in which I am trying to show open purchase orders and line items for that PO. I want to bring back all open PO's from an Access 2007 table, allow user to click on the PO, then based on the selected Cell, show all the order lines from another table onto another DataGridView . I have no problem bringing back and displaying the open PO's on the first DataGridView. I am just struggling with the click commands to determine the SQL statement to display the data in the next DataGridView. After this task, the user needs to be able to CTRL select individual rows to receive just the lines that came in, and pass that info to a DB....
Function 2:
I would like to display items corrdsponding to a selected vendor(from a combo box) to a DataGridView. Since there are typically multiple items for a vendor, combo boxe in the DataGridView are a must. I am already performing this operation with conventional combo boxes, and it working ok, but I am limited to the amount of items the user can choose....
Thanks in advance everyone
-
Oct 18th, 2007, 08:10 AM
#2
Re: DataGridView usage
DataGridView isn't an ASP.NET control. I assume you want winforms - either VB.NET or C#.
To get your second dgv to display the data, you'll obviously handle the click event. You can go
Code:
DataGridViewRow dgvr = DGV1.SelectedRows[0];
string myForeignKey = dgvr.Cells[0].Value.ToString();
Once you get myForeignKey, you can pass it to your SQL statement/stored procedure, it'll return data which you can then pass to your other datagridview.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|