I need my form to automatically select the first entry in the datagrid view when it is loaded. I am having trouble finding the correct way to code it.
Private Sub CustomersForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim cust = From customers In db.Customers Order By customers.CustName Select customers Me.DataGridView1.DataSource = cust Me.DataGridView1.SelectedCells() = '??? Do I assign this a value? Dim custselect = DataGridView1.SelectedCells(1).Value Me.CustAccountsDataGridView.DataSource = From accounts In db.CustAccounts Where accounts.AccountNumber = custselect.ToString Select accounts End Sub
Any Ideas? TIA