CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2007
    Posts
    116

    Lightbulb GridView1 Control...

    How can we add scrollbar with GridView1 control in ASP.NET..
    I am using VisualStudio2008...
    Thanks

  2. #2
    Join Date
    Nov 2007
    Location
    .NET 3.5 / VS2008 Developer
    Posts
    624

    Re: GridView1 Control...

    put the gridview control inside of a "div". then set the "overflow" property of the div to "auto".

  3. #3
    Join Date
    Mar 2007
    Posts
    116

    Re: GridView1 Control...

    I have tried it...Not working

  4. #4
    Join Date
    Jan 2009
    Location
    Cochin, India
    Posts
    40

    Smile Re: GridView1 Control...

    Put it inside a panel and set the width and height properties of the panel and scroll bars to both. Here is some sample code

    Code:
            <asp:Panel ID="mypdanel" runat="server" ScrollBars="Both" Height="188px">
            <asp:GridView ID="GridView1" runat="server" Height="169px" Width="918px"></asp:GridView>
            </asp:Panel>
    This will give you a scrollable grid view.

    Warm Regards,
    Jay
    Support Resort
    http://www.supportresort.com
    Bringing offshore expertise to the world

  5. #5
    Join Date
    Nov 2007
    Location
    .NET 3.5 / VS2008 Developer
    Posts
    624

    Re: GridView1 Control...

    Quote Originally Posted by Frank100 View Post
    I have tried it...Not working
    putting a grid inside of a div does work...

    Code:
    <div style="overflow: auto;height: 690px">
    <asp:GridView ID="GridView1" runat="server" Width="660px">
    </asp:GridView>
    </div>
    that, along with the panel as stated above will both work.

  6. #6
    Join Date
    Mar 2007
    Posts
    116

    Re: GridView1 Control...

    Thanks panel and style both working..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured