Click here to Skip to main content
15,845,785 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have one asp .net grid view in this i want to increase or decrease width of the email and website column because its columns size will varies for the different users can any one please help me to solve this issue?

Thanks in advance
Keerthi Kumar
Posted
Comments
[no name] 14-Aug-13 8:50am    
assign gridview width 100%
TrushnaK 14-Aug-13 9:04am    
are you want to do that from code-behind?

1 solution

assign to your gridview width 100%
 
Share this answer
 
Comments
Keerthi Kumar(Andar) 14-Aug-13 9:03am    
sorry its not working...
Keerthi Kumar(Andar) 14-Aug-13 9:08am    
My grid view is like this

<asp:GridView ID="grdHotelDetails" runat="server" HorizontalAlign="Left" AllowSorting="true" Width="100%"
AllowPaging="True" AutoGenerateColumns="False" BorderStyle="None" BorderWidth="0px"
GridLines="None" CellPadding="1" PageSize="12" ShowFooter="false">
<SelectedRowStyle Font-Names="Verdana" HorizontalAlign="Left" CssClass="SelectedItem">
</SelectedRowStyle>
<editrowstyle font-names="verdana">
<alternatingrowstyle font-names="Verdana" horizontalalign="Left" cssclass="AlternatingItemClass">

<footerstyle cssclass="FooterStyleClass">


<PagerStyle CssClass="FooterStyleClass" HorizontalAlign="Left"></PagerStyle>
<PagerSettings Mode="NextPreviousFirstLast" NextPageText="Next" PreviousPageText="Prev"
FirstPageText="First" LastPageText="Last" Visible="true" />
<rowstyle horizontalalign="Left" verticalalign="Middle" cssclass="ItemStyle">
<HeaderStyle Font-Names="Verdana" Font-Bold="True" ForeColor="Black" CssClass="HeaderClass"
HorizontalAlign="Left"></HeaderStyle>
<columns>
<asp:TemplateField HeaderStyle-CssClass="HeaderColumnClass" HeaderText="Email" HeaderStyle-Width="250px">
<HeaderTemplate>
<asp:Label ID="Label3" runat="server" Text="Email">
</HeaderTemplate>
<itemtemplate>
<asp:Label runat="server" ID="lblEmail" Text='<%#DataBinder.Eval(Container.DataItem, "Email")%>' Width="250px">

<edititemtemplate>
<asp:TextBox runat="server" ID="txtEditEmail" Text='<%#DataBinder.Eval(Container.DataItem, "Email")%>' Width="250px" >



<asp:TemplateField HeaderStyle-CssClass="HeaderColumnClass" HeaderText="Website" HeaderStyle-Width="250px">
<HeaderTemplate>
<asp:Label ID="Label3" runat="server" Text="Website">
</HeaderTemplate>
<itemtemplate>
<asp:Label runat="server" ID="lblWebsite" Text='<%#DataBinder.Eval(Container.DataItem, "Website")%>' Width="250px">

<edititemtemplate>
<asp:TextBox runat="server" ID="txtEditWebsite" Text='<%#DataBinder.Eval(Container.DataItem, "Website")%>' Width="250px" Wrap="true" >

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900