Results 1 to 4 of 4

Thread: datagrid

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2004
    Posts
    29

    Cool 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

  2. #2
    Frenzied Member maged's Avatar
    Join Date
    Nov 2002
    Location
    Egypt
    Posts
    1,040
    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

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jul 2004
    Posts
    29
    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

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Jul 2004
    Posts
    29
    Please help!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width