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 8032437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:23:00+00:00 2026-06-05T01:23:00+00:00

I have a gridview which has 13 columns. All the columns are bound field.

  • 0

I have a gridview which has 13 columns. All the columns are bound field.
When data is binded to the gridview, what happens the gridview stretches the page and the layout of the page becomes dull.
The the page on which i have added the girdview is inherited from a mater page and the gridview is inside a panel. We work on percentage and not on pixel so i am facing this problem. If i use pixel to fix the width of the gridview it’s working finr, but not in case of %.
I have tried all the below –

  1. Remove the bound field and used template field and by fixing the itemstyle-width.
  2. Putting the girdview inside a table and applying the styles to set width, overflow and other required properties.
  3. Putting the gridview inside a div and applying the styles to set width, overflow and other required properties.
  4. Adding the gridview inside the panel and then setting the properties of the panel as above.

What works: –
When i fix the “tableLayout” properties of gridview to “fixed” it displays inside the range but all the text overlapped each other and hence all the things becomes useless.

Please suggest me.

Sample Code: –

<table>
            <tr>
                <td>
            <asp:Panel ID="pnlSearchResult" runat="server" Visible="false" Width="97%">
            <div style="overflow:scroll;width:100%;table-layout:fixed">
                <asp:GridView ID="grdSearchResult" runat="server" SkinID="NewGridGS" EmptyDataText="No records found"
                Width="99%">
                    <Columns>                            
                        <asp:BoundField DataField="ECode" HeaderText="Code"/>
                        <asp:BoundField DataField="EName" HeaderText="Name" />
                        <asp:BoundField DataField="Type" HeaderText="V Type" />
                        <asp:BoundField DataField="VName" HeaderText="V Name" />
                        <asp:BoundField DataField="PStartDate" HeaderText="P Start Date" />
                        <asp:BoundField DataField="PEndDate" HeaderText="P End Date" />
                        <asp:BoundField DataField="VStartDate" HeaderText="V Start Date" />
                        <asp:BoundField DataField="VEndDate" HeaderText="V End Date" />
                        <asp:BoundField DataField="OnSite" HeaderText="On Site" />
                        <asp:BoundField DataField="PCode" HeaderText="P Code" />
                        <asp:BoundField DataField="PSCode" HeaderText="PS Code" />
                        <asp:BoundField DataField="AmountUSD" HeaderText="Amount (USD)" />
                        <asp:BoundField DataField="AmountINR" HeaderText="Amount (INR)" />
                    </Columns>
                </asp:GridView>
                </div>
            </asp:Panel>
        </td>
        </tr>
        </table>
  • 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-05T01:23:01+00:00Added an answer on June 5, 2026 at 1:23 am

    Give width of div containing grid in pixels instead of percentage

    <td>
    <div id="divGrid" style='position:absolute; width:800px; overflow:auto'>
    
    <!-- your grid here -->
    
    </div>
    
    </td>
    

    You can take width of screen in pixel and calculate the pixel in percentage. suppose width of screen is 1000 pixel is return by screen.width then you 90% will be 900px.

    <script language="javascript" type="text/javascript">
       document.getElementById('divGrid').style.width = screen.width + "px";
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a GridView on a .aspx page with a hidden column which has
I have one GridView gvDetail which has 30 columns(include both Template and BoundField). In
I have a gridview which displays rows and columns all linked to an sql
I have a page which has a GridView on it, which is populated from
i have a gridview which has one of the columns as a dropdown. When
I have a GridView control on an ASP page, which I've bound to a
I have an ASP.NET GridView which has columns that look like this: | Foo
I have a GridView which is bound to a datasource, which occasionally has a
I have a gridview which has three columns date, pnl, cumpnl I am able
i have made a gridview which has many columns and the editmode , some

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.