PC Review


Reply
Thread Tools Rate Thread

CSS for GridView in a asp:UpdatePanel

 
 
John J. Hughes II
Guest
Posts: n/a
 
      14th Oct 2007
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


 
Reply With Quote
 
 
 
 
John J. Hughes II
Guest
Posts: n/a
 
      21st Oct 2007
Any suggestions??

"John J. Hughes II" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
>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
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
gridview inside updatepanel JohnE Microsoft ASP .NET 1 12th Mar 2010 04:35 AM
updatepanel, gridview, calendar JohnE Microsoft ASP .NET 3 10th Mar 2010 02:04 PM
problem with UpdatePanel in GridView Jeff Microsoft ASP .NET 1 8th Jan 2009 05:51 PM
GridView in UpdatePanel only Updates once Nick Microsoft ASP .NET 8 24th Oct 2008 11:07 AM
Gridview & updatepanel issue SAL Microsoft ASP .NET 13 9th Oct 2008 02:33 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:05 AM.