DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 6 of 6

Thread: Datagrid Scrollbar creation... Veritcal Limit

  1. #1
    Tom Guest

    Datagrid Scrollbar creation... Veritcal Limit


    "David Rothgery" <drothgery@alum.wpi.edu> wrote:
    >
    >"Phil Weber" <pweber@nospam.fawcette.com> wrote in message
    >news:3d36f30b@10.1.10.29...
    >> > I have an aspx page, with a datagrid inside a form. I want to
    >> > limit the size of the datagrid to 15 and have a vertical scrollbar
    >> > so if there more than 15 entries then the user can scroll down
    >> > without the title of the grid fields moving.

    >>
    >> Tom: The Web Forms DataGrid does not have this functionality built in.

    One
    >> option is to embed an ActiveX, Java or Windows Forms grid component in

    >your
    >> page. If you want to use straight HTML, you'll have to display the

    >scrolling
    >> data within an IFRAME.

    >
    >Not necessarily. You could wrap the DataGrid in a DIV tag and use CSS to
    >force scrollbars, likes so...
    >
    ><DIV style="height: 15em; overflow-y: scroll;">
    > <aspatagrid ...
    > </aspatagrid>
    ></DIV>
    >
    >At least, that will certainly work in IE6, and will probably work in IE5+,
    >Opera 5+, and Netscape 6+. And it may work in IE4.x, but I wouldn't count

    on
    >it.
    >
    >
    >--
    >Dave Rothgery
    >drothgery@alum.wpi.edu
    >
    >



    Thanks Dave, that worked a treat!

    A new problem, how can i limit the size of the scrollbar so that it only
    appears when the datagrid exceeds the vertical limit size?

  2. #2
    David A. Rothgery Guest

    Re: Datagrid Scrollbar creation... Veritcal Limit

    Tom <Tom.Ashley@UKAutomation.com> wrote:
    >
    > "David Rothgery" <drothgery@alum.wpi.edu> wrote:
    > >
    > >"Phil Weber" <pweber@nospam.fawcette.com> wrote in message
    > >news:3d36f30b@10.1.10.29...
    > >> > I have an aspx page, with a datagrid inside a form. I want to
    > >> > limit the size of the datagrid to 15 and have a vertical scrollbar
    > >> > so if there more than 15 entries then the user can scroll down
    > >> > without the title of the grid fields moving.
    > >>
    > >> Tom: The Web Forms DataGrid does not have this functionality built in.

    > One
    > >> option is to embed an ActiveX, Java or Windows Forms grid component in

    > >your
    > >> page. If you want to use straight HTML, you'll have to display the

    > >scrolling
    > >> data within an IFRAME.

    > >
    > >Not necessarily. You could wrap the DataGrid in a DIV tag and use CSS to
    > >force scrollbars, likes so...
    > >
    > ><DIV style="height: 15em; overflow-y: scroll;">
    > > <aspatagrid ...
    > > </aspatagrid>
    > ></DIV>
    > >
    > >At least, that will certainly work in IE6, and will probably work in IE5+,
    > >Opera 5+, and Netscape 6+. And it may work in IE4.x, but I wouldn't count

    > on
    > >it.
    > >
    > >
    > >--
    > >Dave Rothgery
    > >drothgery@alum.wpi.edu
    > >
    > >

    >
    >
    > Thanks Dave, that worked a treat!
    >
    > A new problem, how can i limit the size of the scrollbar so that it only
    > appears when the datagrid exceeds the vertical limit size?


    Instead of using overflow-y: scroll , use overflow-y: auto .

    --
    Dave Rothgery
    Picking nits since 1976
    drothgery@alum.wpi.edu
    http://drothgery.editthispage.com

  3. #3
    Tom Guest

    Re: Datagrid Scrollbar creation... Veritcal Limit


    David A. Rothgery <drothgery@alum.wpi.edu> wrote:
    >Tom <Tom.Ashley@UKAutomation.com> wrote:
    >>
    >> "David Rothgery" <drothgery@alum.wpi.edu> wrote:
    >> >
    >> >"Phil Weber" <pweber@nospam.fawcette.com> wrote in message
    >> >news:3d36f30b@10.1.10.29...
    >> >> > I have an aspx page, with a datagrid inside a form. I want to
    >> >> > limit the size of the datagrid to 15 and have a vertical scrollbar
    >> >> > so if there more than 15 entries then the user can scroll down
    >> >> > without the title of the grid fields moving.
    >> >>
    >> >> Tom: The Web Forms DataGrid does not have this functionality built

    in.
    >> One
    >> >> option is to embed an ActiveX, Java or Windows Forms grid component

    in
    >> >your
    >> >> page. If you want to use straight HTML, you'll have to display the
    >> >scrolling
    >> >> data within an IFRAME.
    >> >
    >> >Not necessarily. You could wrap the DataGrid in a DIV tag and use CSS

    to
    >> >force scrollbars, likes so...
    >> >
    >> ><DIV style="height: 15em; overflow-y: scroll;">
    >> > <aspatagrid ...
    >> > </aspatagrid>
    >> ></DIV>
    >> >
    >> >At least, that will certainly work in IE6, and will probably work in

    IE5+,
    >> >Opera 5+, and Netscape 6+. And it may work in IE4.x, but I wouldn't count

    >> on
    >> >it.
    >> >
    >> >
    >> >--
    >> >Dave Rothgery
    >> >drothgery@alum.wpi.edu
    >> >
    >> >

    >>
    >>
    >> Thanks Dave, that worked a treat!
    >>
    >> A new problem, how can i limit the size of the scrollbar so that it only
    >> appears when the datagrid exceeds the vertical limit size?

    >
    >Instead of using overflow-y: scroll , use overflow-y: auto .
    >
    >--
    >Dave Rothgery
    >Picking nits since 1976
    >drothgery@alum.wpi.edu
    >http://drothgery.editthispage.com


    Yeah! also is it possible to "fix" the titles into place so only the items
    scroll?

    Tom

  4. #4
    Tom Guest

    Re: Datagrid Scrollbar creation... Veritcal Limit


    David A. Rothgery <drothgery@alum.wpi.edu> wrote:
    >Tom <Tom.Ashley@UKAutomation.com> wrote:
    >>
    >> David A. Rothgery <drothgery@alum.wpi.edu> wrote:
    >> >Tom <Tom.Ashley@UKAutomation.com> wrote:
    >> >>
    >> >> "David Rothgery" <drothgery@alum.wpi.edu> wrote:
    >> >> >
    >> >> >"Phil Weber" <pweber@nospam.fawcette.com> wrote in message
    >> >> >news:3d36f30b@10.1.10.29...
    >> >> >> > I have an aspx page, with a datagrid inside a form. I want to
    >> >> >> > limit the size of the datagrid to 15 and have a vertical scrollbar
    >> >> >> > so if there more than 15 entries then the user can scroll down
    >> >> >> > without the title of the grid fields moving.
    >> >> >>
    >> >> >> Tom: The Web Forms DataGrid does not have this functionality built

    >> in.
    >> >> One
    >> >> >> option is to embed an ActiveX, Java or Windows Forms grid component

    >> in
    >> >> >your
    >> >> >> page. If you want to use straight HTML, you'll have to display the
    >> >> >scrolling
    >> >> >> data within an IFRAME.
    >> >> >
    >> >> >Not necessarily. You could wrap the DataGrid in a DIV tag and use

    CSS
    >> to
    >> >> >force scrollbars, likes so...
    >> >> >
    >> >> ><DIV style="height: 15em; overflow-y: scroll;">
    >> >> > <aspatagrid ...
    >> >> > </aspatagrid>
    >> >> ></DIV>
    >> >> >
    >> >> >At least, that will certainly work in IE6, and will probably work

    in
    >> IE5+,
    >> >> >Opera 5+, and Netscape 6+. And it may work in IE4.x, but I wouldn't

    count
    >> >> on
    >> >> >it.
    >> >> >
    >> >> >
    >> >> >--
    >> >> >Dave Rothgery
    >> >> >drothgery@alum.wpi.edu
    >> >> >
    >> >> >
    >> >>
    >> >>
    >> >> Thanks Dave, that worked a treat!
    >> >>
    >> >> A new problem, how can i limit the size of the scrollbar so that it

    only
    >> >> appears when the datagrid exceeds the vertical limit size?
    >> >
    >> >Instead of using overflow-y: scroll , use overflow-y: auto .

    >>
    >> Yeah! also is it possible to "fix" the titles into place so only the items
    >> scroll?

    >
    >Not without cheating.
    >
    >i.e. Put the titles in a spearate table outside the datagrid, explicitly


    >set the width of each cell, and then set the columns in the datagrid so


    >things line up.
    >
    >--
    >Dave Rothgery
    >Picking nits since 1976
    >drothgery@alum.wpi.edu
    >http://drothgery.editthispage.com


    Thatís what I had set up already, but when I changed the overflow-y property
    to auto, the scroll bar disappears so the datagrid moves about 10px to the
    right, and when it becomes visible again the datagrid moves back!

    Can you thinks of another way?

    Itís got me stumped!

    Tom


  5. #5
    David A. Rothgery Guest

    Re: Datagrid Scrollbar creation... Veritcal Limit

    Tom <Tom.Ashley@UKAutomation.com> wrote:
    >
    > David A. Rothgery <drothgery@alum.wpi.edu> wrote:
    > >Tom <Tom.Ashley@UKAutomation.com> wrote:
    > >>
    > >> "David Rothgery" <drothgery@alum.wpi.edu> wrote:
    > >> >
    > >> >"Phil Weber" <pweber@nospam.fawcette.com> wrote in message
    > >> >news:3d36f30b@10.1.10.29...
    > >> >> > I have an aspx page, with a datagrid inside a form. I want to
    > >> >> > limit the size of the datagrid to 15 and have a vertical scrollbar
    > >> >> > so if there more than 15 entries then the user can scroll down
    > >> >> > without the title of the grid fields moving.
    > >> >>
    > >> >> Tom: The Web Forms DataGrid does not have this functionality built

    > in.
    > >> One
    > >> >> option is to embed an ActiveX, Java or Windows Forms grid component

    > in
    > >> >your
    > >> >> page. If you want to use straight HTML, you'll have to display the
    > >> >scrolling
    > >> >> data within an IFRAME.
    > >> >
    > >> >Not necessarily. You could wrap the DataGrid in a DIV tag and use CSS

    > to
    > >> >force scrollbars, likes so...
    > >> >
    > >> ><DIV style="height: 15em; overflow-y: scroll;">
    > >> > <aspatagrid ...
    > >> > </aspatagrid>
    > >> ></DIV>
    > >> >
    > >> >At least, that will certainly work in IE6, and will probably work in

    > IE5+,
    > >> >Opera 5+, and Netscape 6+. And it may work in IE4.x, but I wouldn't count
    > >> on
    > >> >it.
    > >> >
    > >> >
    > >> >--
    > >> >Dave Rothgery
    > >> >drothgery@alum.wpi.edu
    > >> >
    > >> >
    > >>
    > >>
    > >> Thanks Dave, that worked a treat!
    > >>
    > >> A new problem, how can i limit the size of the scrollbar so that it only
    > >> appears when the datagrid exceeds the vertical limit size?

    > >
    > >Instead of using overflow-y: scroll , use overflow-y: auto .

    >
    > Yeah! also is it possible to "fix" the titles into place so only the items
    > scroll?


    Not without cheating.

    i.e. Put the titles in a spearate table outside the datagrid, explicitly
    set the width of each cell, and then set the columns in the datagrid so
    things line up.

    --
    Dave Rothgery
    Picking nits since 1976
    drothgery@alum.wpi.edu
    http://drothgery.editthispage.com

  6. #6
    Phil Weber Guest

    Re: Datagrid Scrollbar creation... Veritcal Limit

    > Can you think of another way? Itís got me stumped!

    Tom: As far as I know, those are your only choices: have the scroll always
    visible, and use a separate table above the DIV to display your column
    headings; or, have the scroll bar appear dynamically, and use the DataGrid
    to display the column headings.
    ---
    Phil Weber

    P.S. -- Please trim your quotes when posting replies. For more information
    on DevX discussion group etiquette, see http://news.devx.com/newspolicy.asp
    .. Thanks!



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center