tags:

views:

70

answers:

0

Hi,

I am coding in Visual Basic Express 2008.

I have 2 forms in the solution. Form 1 is the main form and form 2 is the child. The child form being displayed after using a button with the code "Form2.ShowDialoge" I want to select the new row in the datagridview on Form 1 and populate it with data from form 2 without typing on the new line in Form 1. I do not want this to be the default situation by using

Dim M As Integer

M = MultipleSplitsDataGridView.RowCount - 1 Me.MultipleSplitsDataGridView.CurrentCell = Me.MultipleSplitsDataGridView(1, M)

As this will always use the last row and not allow editing of other rows in the grid on Form 1.

I have tried the code:

Me.MultipleSplitsDataGridView.Rows(Me.MultipleSplitsDataGridView.RowCount - 1).Selected = True

only puts the "*" and triagle in the row header but not the pencil. When I press the button to go to Form 2, the triangle goes back to the previous row in the datagridview on Form 1.

I had the correct one line of code in VB2005 but converted to 2008 and lost it in the process and cannot re-create the required process - silly me for not taking a backup! I have trawled Google for days without success.

Help please

Mike