Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / VB.NET / March 2008

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bob - 31 Mar 2008 02:23 GMT
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
Cor Ligthert[MVP] - 31 Mar 2008 05:26 GMT
Bob,

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

Cor

> Hello,
>
[quoted text clipped - 18 lines]
>
> Bob

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.