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?
Kenny - 24 Nov 2006 11:26 GMT
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.