VB .net help

fez

fez

Caporegime
Joined
22 Aug 2008
Posts
28,017
Location
Tunbridge Wells
Hi guys,

Just working on a little project at work and was wondering if what I want to do is possible. I am iterating over a table and then drawing that data onto the form using a control that is repeated vertically. This is all good however when I add a new row to the bottom of the form ( a blank record) for the user to add to the data I am left at the top of the screen with the new record at the bottom with a load of scrolling to do.

My question is whether it is possible to automatically focus on the new control once it has been created even though it may be 2 or 3 pages down.

Thanks
 
Not tried it recently, but I do remember that when you set the focus of something that was out of view it wouldn't jump to it.

Whether it's changed recently with 3.5 I haven't tested, but what I've done in the past is create a bookmark at the control and navigated to that bookmark.
 
I have found out the issue and there is a method called ScrollControlIntoView. You pass it a control and it will scroll the controls container to show the control.
 
I have found out the issue and there is a method called ScrollControlIntoView. You pass it a control and it will scroll the controls container to show the control.

Y'know my fault, I read it as Asp.Net not VB.Net.

Yes, that works fine.
 
Back
Top Bottom