Auto Scroll DataGrid?

K

Kenny

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?
 
K

Kenny

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top