Gridview-Can't adjust column width

M

msch-prv

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_SelectedIndexChanged"
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>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top