我想可以自动换行 但是不能撑大行宽 影响美观
大家给个可行的方案
3 个解决方案
#1
<asp:GridView ID="gvProducts" runat="server" AutoGenerateColumns="False" Width="100%"
OnPageIndexChanging="gvProducts_PageIndexChanging" AllowPaging="true" PageSize="15" AllowSorting="true" >
<Columns>
<asp:BoundField DataField="KG02" HeaderText="No# ↑↓" HeaderStyle-HorizontalAlign="Center"
ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center" SortExpression="kg02"></asp:BoundField>
<asp:TemplateField HeaderText="GuestName ↑↓" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center" SortExpression="kg03_en">
<ItemTemplate>
<a href="../sales/fo_guest_view.aspx?gid=<%#Eval("KG02") %>"><%#Eval("KG03_EN") %></a>
</ItemTemplate>
<ItemStyle Width="5%"></ItemStyle>
</asp:TemplateField>
</Columns>
</asp:GridView>
OnPageIndexChanging="gvProducts_PageIndexChanging" AllowPaging="true" PageSize="15" AllowSorting="true" >
<Columns>
<asp:BoundField DataField="KG02" HeaderText="No# ↑↓" HeaderStyle-HorizontalAlign="Center"
ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center" SortExpression="kg02"></asp:BoundField>
<asp:TemplateField HeaderText="GuestName ↑↓" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center" SortExpression="kg03_en">
<ItemTemplate>
<a href="../sales/fo_guest_view.aspx?gid=<%#Eval("KG02") %>"><%#Eval("KG03_EN") %></a>
</ItemTemplate>
<ItemStyle Width="5%"></ItemStyle>
</asp:TemplateField>
</Columns>
</asp:GridView>
#2
这个.你设置下gridview的宽就可以了.这样gridview的宽一直都是那个数值,不会因为数据的关系变动
你可以试试哦..
你可以试试哦..
#3
GridView width 属性100%
每列指定宽度
每列指定宽度
#1
<asp:GridView ID="gvProducts" runat="server" AutoGenerateColumns="False" Width="100%"
OnPageIndexChanging="gvProducts_PageIndexChanging" AllowPaging="true" PageSize="15" AllowSorting="true" >
<Columns>
<asp:BoundField DataField="KG02" HeaderText="No# ↑↓" HeaderStyle-HorizontalAlign="Center"
ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center" SortExpression="kg02"></asp:BoundField>
<asp:TemplateField HeaderText="GuestName ↑↓" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center" SortExpression="kg03_en">
<ItemTemplate>
<a href="../sales/fo_guest_view.aspx?gid=<%#Eval("KG02") %>"><%#Eval("KG03_EN") %></a>
</ItemTemplate>
<ItemStyle Width="5%"></ItemStyle>
</asp:TemplateField>
</Columns>
</asp:GridView>
OnPageIndexChanging="gvProducts_PageIndexChanging" AllowPaging="true" PageSize="15" AllowSorting="true" >
<Columns>
<asp:BoundField DataField="KG02" HeaderText="No# ↑↓" HeaderStyle-HorizontalAlign="Center"
ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center" SortExpression="kg02"></asp:BoundField>
<asp:TemplateField HeaderText="GuestName ↑↓" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center" SortExpression="kg03_en">
<ItemTemplate>
<a href="../sales/fo_guest_view.aspx?gid=<%#Eval("KG02") %>"><%#Eval("KG03_EN") %></a>
</ItemTemplate>
<ItemStyle Width="5%"></ItemStyle>
</asp:TemplateField>
</Columns>
</asp:GridView>
#2
这个.你设置下gridview的宽就可以了.这样gridview的宽一直都是那个数值,不会因为数据的关系变动
你可以试试哦..
你可以试试哦..
#3
GridView width 属性100%
每列指定宽度
每列指定宽度