Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Auto Scroll DataGrid?

Reply
Thread Tools

Auto Scroll DataGrid?

 
 
Kenny
Guest
Posts: n/a
 
      11-23-2006
i have a datagrid within div tags. the datagrid displays details about
appointments past and present for current calendar month ordered by
date. (worst case - a couple of hundred rows) The datagrid scrolls
properly to show the rows that aren't on screen but i would also like to
auto scroll the datagrid to show the appointments relating to today at
the top. any ideas?



*** Sent via Developersdex http://www.developersdex.com ***
 
Reply With Quote
 
 
 
 
Kenny
Guest
Posts: n/a
 
      11-24-2006
i figured it out. it wasn't too bad, but i know very little about
javascript.

i included a javascript function like this in my HTML:
window.onload = function(){
document.getElementById("laySessions").scrollTop =
document.getElementById("txtPosition").value ;
}

and calculated the value in txtPosition by using
datatable.Select("STARTTIME < '" & Now.Today & "'").GetUpperBound(0)
to return the number of rows that i want to scroll past.
finally i multiplied the returned value by 17.8 (the height of an
individual row) and rounded it off.




*** Sent via Developersdex http://www.developersdex.com ***
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto Shipping Auto Shipping Scheduling:car moving auto transport linkswanted ASP .Net 0 02-16-2008 02:40 AM
change the scroll speed of a scroll pane? Kevin Java 1 02-05-2005 09:42 AM
prevent mouse scroll to scroll in a dropdownlist nicholas ASP .Net 0 12-07-2004 11:26 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57