|
-
Jul 27th, 2004, 11:42 PM
#1
Thread Starter
Junior Member
datagrid
Hi,
I created 2 forms, from Form1 i click a button1 to display Form2. In Form2 i double click the specific row of the products from the grid and bind the data to the grid in Form1. Click button1 again if i want more products and add into the grid in Form1.
Is it possible to bind the data from 1 grid to another grid in different form?
how do add another row in the grid if i want to add more products??
Please HELP!!
Thanks
Viv
-
Jul 28th, 2004, 01:58 AM
#2
Frenzied Member
i assume you are using ADO.Net, well you can just create a public dataset that contains your transactions data. Then you can bind both Controls in different forms on it. This way , your code should manipulate the dataset in memory and the 2 controls should gain the new data autromatically.
I hope this would help
BST RGDS
-
Jul 28th, 2004, 06:27 AM
#3
Thread Starter
Junior Member
Hi,
i am still not clear. please help.
heres part of the coding of 2 forms
on Form1
Private Sub btnAddRental_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAddRental.Click
Dim f As New frm2
f.ShowDialog()
??????how to bind the data from grid in Form2 to the grid in Form1??
End Sub
End Class
on Form2
Dim v As strVideos
Public Structure strVideos
Dim videoNo, videoT, Actor1, Actor2 As String
End Structure
Public ReadOnly Property selecteditems() As strVideos
Get
Return v
End Get
End Property
Private Sub DataGrid1_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGrid1.DoubleClick
v.videoNo = DataGrid1.Item(DataGrid1.CurrentCell.RowNumber, 0)
v.videoT = DataGrid1.Item(DataGrid1.CurrentCell.RowNumber, 1)
v.Actor1 = DataGrid1.Item(DataGrid1.CurrentCell.RowNumber, 2)
v.Actor2 = DataGrid1.Item(DataGrid1.CurrentCell.RowNumber, 3)
Close()
End Sub
Thanks
viv
-
Jul 29th, 2004, 02:31 AM
#4
Thread Starter
Junior Member
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
|