Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7729537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T05:59:36+00:00 2026-06-01T05:59:36+00:00

I have a gridivew with auto-generated fields, whenever there is a new set of

  • 0

I have a gridivew with auto-generated fields, whenever there is a new set of data coming in, i will append the grid with data. Is there a way to set a limited columns (e.g 6) so as to force user to navigate to the next page? instead of kept appending till it is super ugly?

Example:

enter image description here

thus, there could be Grade(12 July 2012), Grade(4 April 2013) and so on….

though i can find pagesize, but i cannt find columnsize!

Edited:

enter image description here

I manage to add a scrollbar at the bottom of the gridview. However the grid with auto-generated columns tends to be a little clustered. (if you notice the name column from second pic). Can any one help?

Code:

 <asp:Panel ID="ScrollPanel" style="Width:1300px;" runat="server" ScrollBars="Horizontal"> 
                    <asp:GridView ID="ViewAllHistory" runat="server" BorderWidth="1px" 
                        CellPadding="2" CellSpacing="2" AllowPaging="True" BackColor="Black" 
                        onpageindexchanging="ViewAllHistory_PageIndexChanging" PageSize="10">
                        <RowStyle BackColor="White"/>
                        <FooterStyle BackColor="#CCCCCC" />
                        <PagerSettings Position="TopAndBottom" />
                        <PagerStyle HorizontalAlign="Center" BackColor="White" />
                        <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
                    </asp:GridView>
                    </asp:Panel>

it is only when i fix my gridview width then the design looks better. But i wouldnt want to fix my grid’s width considering new set of data coming in. (long-term)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T05:59:38+00:00Added an answer on June 1, 2026 at 5:59 am

    Modify the columns collection
    One way to do this is would be to have all of the columns you’re going to need already in your datasource, and then just modify the Columns collection of your GridView. So, for instance, you have a button that adds a column, and you do this in it’s click event:

    protected void Button1_Click(object sender, EventArgs e)
    {
        BoundField newCol = new BoundField();
        // This string needs to be the name of the column in your datasource
        newCol.DataField = "Grade12July2012";
        // Whatever you want the column header to say
        newCol.HeaderText = "Grade(12 July 2012)";
        GridView1.Columns.Add(newCol);
        GridView1.DataBind();
    }
    

    Use a scrollable <div>
    As alex said in the comments, another way of doing this would be to just put a scrollable container around your GridView. This way you can have all the columns there without taking up too much screen real estate:

    <div id="gridContainer" style="width:200px; overflow:scroll; height:auto;">
        <asp:GridView ID="GridView1" runat="server">
    
        </asp:GridView>
    </div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using gridView. I have 4 auto generated columns and 1 generated by
I have set up jqGrid with JSON in my .Net MVC project. The grid
I have GridView, which is not auto generating columns. In GridView there are 3
I have a baseAdapter class that adds data to a Gridview. Please is there
I have a gridview in that fields are generated at runtime using AutoGenerateColumns=True. Before
Have a gridview control which will show X amount of rows. I want to
Let's say I have the following ListView: <ListView ScrollViewer.VerticalScrollBarVisibility=Auto> <ListView.View> <GridView> <GridViewColumn Header=Something DisplayMemberBinding={Binding
I have an application that extracts data from some xml that is stored in
I have used BaseAdapter for grid view, in getView method of BaseAdapter I am
I have a GridView that pulls data out of the database and populates its

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.