Worrow Posted February 8, 2006 Posted February 8, 2006 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. Quote
teixeira Posted February 18, 2006 Posted February 18, 2006 (edited) Hi, I made an example and i think it will help you, see atachment. Rgds, Tiago TeixeiraTestDGV.zip Edited February 18, 2006 by PlausiblyDamp Quote
Worrow Posted February 20, 2006 Author Posted February 20, 2006 Thanks for your reply. The problem I got is the dataset somehow sorted my newly added data. Let's 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 didn't :o Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.