possible to add scrollbar to dynamically created gridview?

Last post 10-22-2007 5:51 AM by naturehermit. 6 replies.

Sort Posts:

  • possible to add scrollbar to dynamically created gridview?

    10-22-2007, 4:26 AM
    • Member
      20 point Member
    • lingz
    • Member since 07-18-2007, 9:39 AM
    • Posts 35

    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,

  • Re: possible to add scrollbar to dynamically created gridview?

    10-22-2007, 4:43 AM
    • Star
      12,429 point Star
    • ca8msm
    • Member since 11-29-2005, 3:57 PM
    • http://mdssolutions.co.uk
    • Posts 2,152

    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.

    Website Design Darlington - http://mdssolutions.co.uk
    http://lessthandot.com - Experts, Information, Ideas & Knowledge
    http://aspnetlibrary.com - An online resource for professional ASP.NET developers


    Please remember to click "Mark as Answer" on this post if it helped you

  • Re: possible to add scrollbar to dynamically created gridview?

    10-22-2007, 4:49 AM

    Hi There,

     

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

     

    Good luck

    Please Mark Post that helped you as answer, also include a summary of what solved the problem as it helps others in similar situations
  • Re: possible to add scrollbar to dynamically created gridview?

    10-22-2007, 5:42 AM
    • Member
      20 point Member
    • lingz
    • Member since 07-18-2007, 9:39 AM
    • Posts 35

    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.

     

  • Re: possible to add scrollbar to dynamically created gridview?

    10-22-2007, 5:43 AM
    • Member
      20 point Member
    • lingz
    • Member since 07-18-2007, 9:39 AM
    • Posts 35

    ca8msm:

    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?

  • Re: possible to add scrollbar to dynamically created gridview?

    10-22-2007, 5:48 AM
    Answer
    • Star
      12,429 point Star
    • ca8msm
    • Member since 11-29-2005, 3:57 PM
    • http://mdssolutions.co.uk
    • Posts 2,152

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

    Website Design Darlington - http://mdssolutions.co.uk
    http://lessthandot.com - Experts, Information, Ideas & Knowledge
    http://aspnetlibrary.com - An online resource for professional ASP.NET developers


    Please remember to click "Mark as Answer" on this post if it helped you

  • Re: possible to add scrollbar to dynamically created gridview?

    10-22-2007, 5:51 AM
    Answer

    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..

    Please Mark Post that helped you as answer, also include a summary of what solved the problem as it helps others in similar situations
Page 1 of 1 (7 items)