Try css rule tablelayout:fixed
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
<msch-> wrote in message
news: oups.com...
>I have difficulties adjusting the column width of a gridview control.
> The column width changes appear in the design grid, but at run-time the
> width changes back to what I presume are the grid's default settings.
>
> Idem for the pager settings: the page settings are spread over the grid
> width (justified) instead of being grouped on the left hand side. I
> tried changing various settings and adding some CSS to no avail.
>
> Thanks for any suggestions Mark
>
> Code:
> <div style=" background-color: #CCFFFF; padding: 0.5em; border:1px
> solid; font-size: small; ">
>
> <asp:GridView ID="grdTasks1" AllowPaging="True"
> AutoGenerateColumns="False"
> EmptyDataText="No records found" PageSize="5"
> runat="server" OnPageIndexChanging="grdAct_PageIndexChanging"
> AllowSorting="True"
> DataKeyNames="ActID,ActDueDay"
> OnSorting="grdAct_Sorting"
> OnSelectedIndexChanged="grdAct_SelectedIndexChange d"
> CaptionAlign="Left" Caption="Grid" GridLines="None"
> CellPadding="2" PagerStyle-HorizontalAlign="Left">
>
> <Columns>
>
> <asp:BoundField DataField="PrjDesc1" HeaderText="Project"
> HeaderStyle-Width="25px" SortExpression="PrjDesc1" />
>
> <asp:BoundField DataField="ActAssgnN" HeaderText="Assignee"
> HeaderStyle-Width="25px" SortExpression="ActAssgnN" />
>
> <asp:BoundField DataField="ActStat" HeaderText="Status"
> SortExpression="ActStat" />
>
> <asp:BoundField DataField="FromName" HeaderText="From"
> SortExpression="FromName" />
>
> <asp:BoundField DataField="ActDueDay" HeaderText="Due Day"
> SortExpression="ActDueDay" />
>
> <asp:BoundField DataField="ActPrio" HeaderText="Priority"
> SortExpression="ActPrio" />
>
> </Columns>
>
> <PagerSettings Mode="NumericFirstLast" />
> </asp:GridView>
> </div>
>
|