user1181942
user1181942

Reputation: 1607

Grid View Pager Style issue

1My gridview code is like:

<asp:GridView runat="server"
    ID="gvOpenProblems"
    AutoGenerateColumns="true"
    BorderColor="Black"
    OnRowCreated="gvOpenProblems_RowCreated"
    OnRowDataBound="gvOpenProblems_RowDataBound"
    HeaderStyle-HorizontalAlign="Center"
    Width="2000px"
    AllowPaging="true"
    PageSize="20"
    OnPageIndexChanging="gvOpenProblems_PageIndexChanging">

    <RowStyle HorizontalAlign="Left" />
    <PagerStyle CssClass="gridpager"
        HorizontalAlign="Left"
        Width="200px" />

And CSS is like:

.gridpager, .gridpager td {
    text-align: left;
    color: Green;
    font-weight: bold;
    text-decoration: none;
    border: 0;
    position: relative;
    margin-left: auto;
    margin-right: auto;
    padding: 0px;
}

.gridpager a {
    color: Red;
    font-weight: normal;
}

This works fine normally but when the number of pages is more than 10, and when I click on 10th page or 11th page all page numbers spread and go out of grid.

Check image

Is this a normal issue or is it an issue with the CSS?

Upvotes: 1

Views: 4713

Answers (1)

Kevin Dark
Kevin Dark

Reputation: 476

The problem is that you're setting the width to 200px. You'd be forgiven for thinking that this applies to the containing table that the paging controls are held in, but it's not, it's the TD that the a & span tags are contained in.

Upvotes: 1

Related Questions