R
Randy Fraser
Hi All
I am trying to (with a button click) add a new row to a datagrid and then
set focus on the first column of the new row. I have waisted almost a day
on this now and still can't get it to work. Any help would be greatly
appreciated.
Here is some code
Private Sub btnAdd_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnAdd.Click
Dim nrecords As Integer = ds.Tables(0).Rows.Count
addRecord()
'Here I need to set focus on the new cell in the datagrid.
End Sub
Protected Overridable Sub addRecord()
ds.Tables(0).DefaultView.AllowNew = True
bNewRow = True
bmb.AddNew()
bmb.Position = bmb.Count - 1
ds.Tables(0).DefaultView.AllowNew = False
Me.SetButtons(1)
End Sub
Thanks
Randy
I am trying to (with a button click) add a new row to a datagrid and then
set focus on the first column of the new row. I have waisted almost a day
on this now and still can't get it to work. Any help would be greatly
appreciated.
Here is some code
Private Sub btnAdd_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnAdd.Click
Dim nrecords As Integer = ds.Tables(0).Rows.Count
addRecord()
'Here I need to set focus on the new cell in the datagrid.
End Sub
Protected Overridable Sub addRecord()
ds.Tables(0).DefaultView.AllowNew = True
bNewRow = True
bmb.AddNew()
bmb.Position = bmb.Count - 1
ds.Tables(0).DefaultView.AllowNew = False
Me.SetButtons(1)
End Sub
Thanks
Randy