CSS for GridView in a asp:UpdatePanel

J

John J. Hughes II

I have a GridView in an update panel. The CSS to set it to 100% does not
work. If I remove the GridView from the UpdatePanel goes to 100% correctly.
Below is my wonderful code, am I doing something wrong or is there a work
around?

CSS...
..gridviewClass
{
width: 100%;
}


ASP Stuff...
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:GridView ID="eventsGridView"
runat="server"
AllowPaging="True"
AllowSorting="True"
AutoGenerateColumns="False"
DataKeyNames="GroupName,MemberName,StartTime"
DataSourceID="EventList"
CssClass="gridviewClass"
AlternatingRowStyle-CssClass="even"
GridLines="None">
<Columns>
<asp:CommandField ShowEditButton="True" />
<asp:BoundField DataField="ID" HeaderText="ID"
SortExpression="ID" Visible="False" />
<asp:BoundField DataField="GroupName"
HeaderText="GroupName" ReadOnly="True" SortExpression="GroupName"
Visible="False" />
<asp:BoundField DataField="MemberName"
HeaderText="MemberName" ReadOnly="True" SortExpression="MemberName"
Visible="False" />
<asp:BoundField DataField="Name" HeaderText="Name"
SortExpression="Name" />
<asp:BoundField DataField="EventType" HeaderText="Event
Type" SortExpression="EventType" />
<asp:BoundField DataField="StartTime" HeaderText="Start
Time" ReadOnly="True" SortExpression="StartTime" />
<asp:BoundField DataField="EndTime" HeaderText="EndTime"
SortExpression="EndTime" />
<asp:CheckBoxField DataField="AllDay" HeaderText="All
Day" SortExpression="AllDay" />
<asp:BoundField DataField="Comments"
HeaderText="Comments" SortExpression="Comments" />
</Columns>
</asp:GridView>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="memberDropList"
EventName="SelectedIndexChanged" />
</Triggers>
</asp:UpdatePanel>

Regards,
John
 

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

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top