Skip to main content
MusicManMD
Known Participant
September 24, 2010
Question

Add a Horizontal Scroll bar to a cfgrid

  • September 24, 2010
  • 1 reply
  • 2129 views

Any ideas how I can add a horizontal scroll bar to a cfgrid?  My grid goes off the page on some computers because of their screen resolution.

I tried the following woith no luck:

<cfgrid style="overflow-x:scroll; width:800px;">

    This topic has been closed for replies.

    1 reply

    September 30, 2010

    Hi there,

         If you were to put the cfgrid in it's own DIV and set it to overflow:auto that (I think) should do the trick.  You would want to set the padding and margin of the div to 0 so that it really just acts as a container for the grid.  I realize this is only a hack but it's one that I think should give you what you want with a minimal of efford.

         On the flip side if you use s CFDIV you also have the option of dynamically changing out the entire body of the div.  I suppose that might make it worth the time.

    Hope this helps!

    -Joe

    MusicManMD
    Known Participant
    September 30, 2010

    Thanks but I have figured it out.  To get a horizontal scrollbar within the grid you will need to do the following:

    1) Set grid size "width" and "height"

    2) Set gridcolumnwidth to be larger than the cfgrid width

    There you have it, a horizontal scrollbar magically appears.