Display Grid Data on Multiple Forms

I've got a VB app where the dataset is driven by a sql server. I simple load the data at form load event and display it in a grid on the Form1.
I want the ability to allow the user to select the a row and then display the detailed information in a another form using textboxes. - Form2.
I cant for the life of me figure out out how to get the information to appear on Form2 without adding an additional grid, which I dont want to do and allow changes to be made back to the grid on Form1.
I know that form2 has to have access the orginal grid data somehow I just can get it.
DFCRJAsked:
Who is Participating?
 
fredmastroConnect With a Mentor Commented:
You can't have two forms...  but you can what I think you want to do...
How about a GridView like you said with all your data.. and then when they select it.. it shows the detailed information below in a detailsview control?  Then can update it and save it back to gridview.
Want code for that?
0
 
DFCRJAuthor Commented:
Absolutely..
Tell me this, how does it work in a situation where you have a grid and you do a find and replace?
0
 
DFCRJAuthor Commented:
I was able to view the grid columns on form 1 in a combo box on form 2 without creating a duplicate grid by passing  my code into form 1 as a Public Property and then return the value.
 
Form 2 :
Public GridView As New DevExpress.XtraGrid.Views.Grid.GridView
Public Sub LoadColumnCombo()
        For Each GridColumn As DevExpress.XtraGrid.Columns.GridColumn In GridView.Columns
            cmbColumns.Items.Add(GridColumn.FieldName)
        Next
End Sub

Form 1:
  Dim fr As New FindandReplace
        fr.GridView = GridView1
        fr.LoadColumnCombo()
        fr.ShowDialog(Me)
0
 
DFCRJAuthor Commented:
Dont care about the points, that solution worked for my situation.
0
All Courses

From novice to tech pro — start learning today.