locked
possible to add scrollbar to dynamically created gridview? RRS feed

  • Question

  • User-807523309 posted

    I have read articles on adding scrollbar to gridview, but I didn't find any for dynamically created gridview.

    I am currently creating gridviews at runtime, I want to add scrollbar to shorten the long list.

    I am not sure it is possible to fulfill?

     

    thanks,

    Monday, October 22, 2007 4:26 AM

Answers

  • User-1426124666 posted

    Yes, in exactly the same way that you create any other dynamic control. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, October 22, 2007 5:48 AM
  • User-1091210821 posted

    Well you can always place a panel (panel translates to div) or div directly inside placeholder (placeholder doesnt translate to anything but gives direct code) and put the dynamic gridview inside it. Style the panel or div with Css as suggested and off you go..

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, October 22, 2007 5:51 AM

All replies

  • User-1426124666 posted

    You will need to add them to a div (which can also be created dynamically if necessary) which has overflow:auto set along with the required height and width.

    Monday, October 22, 2007 4:43 AM
  • User-1091210821 posted

    Hi There,

     

    Please look at this forum where this has already been answered http://forums.asp.net/p/1168493/1956130.aspx#1956130

     

    Good luck

    Monday, October 22, 2007 4:49 AM
  • User-807523309 posted

    I have read this post, but I think my question is a little different.

    The gridview count is not determined until the runtime. So I just add a PlaceHolder control to the page, and add the GridView control into the PlaceHolder dynamically.

    I use VS 2005 with c#. It's code behinde file. And I have no idea where to put <div> into page scripts.

     

    Monday, October 22, 2007 5:42 AM
  • User-807523309 posted

    You will need to add them to a div (which can also be created dynamically if necessary) which has overflow:auto set along with the required height and width.

    Is there any way to add the <div> to page scripts by code behind files?

    Monday, October 22, 2007 5:43 AM
  • User-1426124666 posted

    Yes, in exactly the same way that you create any other dynamic control. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, October 22, 2007 5:48 AM
  • User-1091210821 posted

    Well you can always place a panel (panel translates to div) or div directly inside placeholder (placeholder doesnt translate to anything but gives direct code) and put the dynamic gridview inside it. Style the panel or div with Css as suggested and off you go..

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, October 22, 2007 5:51 AM