Select a newly added row in DataGridview.

Worrow

Well-known member
Joined
Jul 10, 2003
Messages
67
Hi,

I added a row to the datagridview with following codes:
Dim drx As DataRow
drx = _DataSet.Tables(0).NewRow
drx.Item(0) = 1
drx.Item(1) = id
...
_DataSet.Tables(0).Rows.Add(drx)

I want my datagirdview automatically selected this new row right after the codes above. How can this be done?

Thanks in advance.
 
Thanks for your reply. The problem I got is the dataset somehow sorted my newly added data. Lets say my current datagridview is sorted by the first column. If I add a record there, it will be added in sorted order. Which means it may not be added at the end of the datagrid.

I thought I have written this (sort problem)down at the beginning of my first post, but I didnt :o
 
Back
Top