By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,501 Members | 2,817 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,501 IT Pros & Developers. It's quick & easy.

Add / Delete record from table - How to reposition selected record in datagridview???

P: n/a
Bob
Hello,

Using VB 2005.net.

I have a bound datagridview and a delete button control (or when the user pressed the 'Delete' key) I can successfully delete the selected record from
the table and it is removed from the dgv. But then I want to select the previous row in the dgv and select it so on 'Select Index Changed' event I
can populate text boxes referring to the selected row. The user may have selected the 5th row in the dgv then scrolled down to the 80th row and
pressed the delete button. I want to position at the 4th row of the dgv.

This is all about selecting rows in dgv, underlying table modification and bringing a selected row into the visible area of the dgv.

If you have a better way of accomplishing this, please direct me to a link or post instructions/code to get this task done.

Thanks,

Bob
Mar 31 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Bob,

Use the currencymanager and with that set the postion on 5 again (or
whatever you want)

Cor
"Bob" <Bo*@No-Address.comschreef in bericht
news:oe********************************@4ax.com...
Hello,

Using VB 2005.net.

I have a bound datagridview and a delete button control (or when the user
pressed the 'Delete' key) I can successfully delete the selected record
from
the table and it is removed from the dgv. But then I want to select the
previous row in the dgv and select it so on 'Select Index Changed' event I
can populate text boxes referring to the selected row. The user may have
selected the 5th row in the dgv then scrolled down to the 80th row and
pressed the delete button. I want to position at the 4th row of the dgv.

This is all about selecting rows in dgv, underlying table modification and
bringing a selected row into the visible area of the dgv.

If you have a better way of accomplishing this, please direct me to a link
or post instructions/code to get this task done.

Thanks,

Bob
Mar 31 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.