viviansm

viviansm

  • NA
  • 21
  • 0

Double click on DataGrid

Jul 23 2004 4:37 AM
I am a beginner in VB.Net. Please help me to solve the following problems. I have created 2 forms - frmCustomer, frmSearch. In the frmCustomer contains of some textbox(txtCustLastName,txtCustFirstName,txtDoB.......) and some buttons. When the user click on the btnSearch , it will show the frmSearch. There are a comboBox and a datagrid in the frmSearch. The comboBox contains of the first alphabet of the LastName (, A - Z), when the user selected the first alphabet of the customer last name and click on the search button. All the customer details of that selected alphabet will display in the datagrid. When the user double click on the particular row of the datagrid, the details of that customer will display in the frmCustomer. How can i write the code in the datagrid double click event?? Below is the search event Private Sub btnSearchName_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearchName.Click With Me.DataSet11.Tables("Customers") With DataGrid1 .CaptionText = "Search by Last Name" End With If cboLastName.Text = "ALL" Then .DefaultView.RowFilter = "CustLName like '%'" Else .DefaultView.RowFilter = "CustLName like '" & cboLastName.Text & "%'" End If If .DefaultView.Count = 0 Then MessageBox.Show("Data not found !.", "VideoMate", MessageBoxButtons.OK, MessageBoxIcon.Information) End If If BindingContext(Me.DataSet11.Customers).Position < 0 Then With DataGrid1 .CaptionText = "Database is empty !" End With End If Me.DataGrid1.DataSource = .DefaultView End With End Sub Private Sub DataGrid1_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGrid1.DoubleClick What is the coding here ??? End Sub Thanks viv

Answers (2)