Auto Scroll DataGrid?

Discussion in 'ASP .Net Datagrid Control' started by Kenny, Nov 23, 2006.

  1. Kenny

    Kenny Guest

    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 ***
    Kenny, Nov 23, 2006
    #1
    1. Advertising

  2. Kenny

    Kenny Guest

    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 ***
    Kenny, Nov 24, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. nicholas
    Replies:
    0
    Views:
    422
    nicholas
    Dec 7, 2004
  2. Kevin
    Replies:
    1
    Views:
    9,490
    Roland
    Feb 5, 2005
  3. Sathiamoorthy

    Enable Scroll up and scroll down in CR-report

    Sathiamoorthy, Nov 9, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    871
    zobalee
    Nov 28, 2006
  4. UJ
    Replies:
    1
    Views:
    549
    John Timney \(MVP\)
    Nov 1, 2006
  5. linkswanted
    Replies:
    1
    Views:
    866
Loading...

Share This Page