Click here to Skip to main content
15,918,742 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

How to scroll down web page based on records present in grid control.

For Example,


I have Employee Search application, I will enter employee id in search box and click search button, if the records in grid does not fit in current page, then the page need to scroll down and show the record present in last row else then page need to be in same position using jquery and asp.net C#.

Here Button is the asp.net and binding the records to the grid on click event of the button not the jquery call. And there is no pagination for the grid control.
Posted
Updated 9-Nov-14 21:25pm
v2

1 solution

Hi,

$('html,body').animate({ scrollTop: $(Element).offset().top }, 500);

The Element is get by
$('.GridView .toControl:first') or $( "GridView .toControl:contains('anyMatchingString')")

or use any jquery traverse methods..

Thanks,
Magesh M
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900