GridView如何固定每一行的高度? GridView 绑定数据之后 数据自动换行 现在是这样的: 123 123 123 123 456 456 456 456怎么变成这样: 123 123 123123 456 456 456456 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <asp:GridView ID="GridView1" ShowFooter="true" BorderColor="Black" OnRowDataBound="GridView1_RowDataBound" runat="server" AutoGenerateColumns="False" Font-Size="12px" Width="530px" AllowSorting="True"> <Columns> <asp:TemplateField HeaderText="账号"> <ControlStyle Width="100px" /> <ItemTemplate> <asp:Label ID="lbID" runat="server" Text='<%# Bind("EmpID") %>'></asp:Label> </ItemTemplate> <FooterTemplate> <asp:TextBox ID="txtID" runat="server"></asp:TextBox> </FooterTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="姓名"> <ControlStyle Width="100px" /> <ItemTemplate> <asp:Label ID="lbRealName" runat="server" Text='<%# Bind("EmpRealName") %>'></asp:Label> </ItemTemplate> <FooterTemplate> <asp:TextBox ID="txtRealName" runat="server"></asp:TextBox> </FooterTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="性别"> <ItemTemplate> <asp:Label ID="lbSex" runat="server" Text='<%# Bind("EmpSex") %>'></asp:Label> </ItemTemplate> <FooterTemplate> <asp:DropDownList ID="ddlSex" runat="server"> <asp:ListItem Value="男">男</asp:ListItem> <asp:ListItem Value="女">女</asp:ListItem> </asp:DropDownList> </FooterTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="住址"> <ControlStyle Width="200px" /> <ItemTemplate> <asp:Label ID="lbAddress" runat="server" Text='<%# Bind("EmpAddress") %>'></asp:Label> </ItemTemplate> <FooterTemplate> <asp:TextBox ID="txtAddress" runat="server" Width="80px"></asp:TextBox> <asp:Button ID="btnAdd" runat="server" Text="添 加" OnClick="btnAdd_Click" /> <asp:Button ID="btnCancel" runat="server" Text="取 消" OnClick="btnCancel_Click" /> </FooterTemplate> </asp:TemplateField> </Columns> <HeaderStyle BackColor="Azure" Font-Size="12px" HorizontalAlign="Center" /> <RowStyle HorizontalAlign="Center" /> <PagerStyle HorizontalAlign="Center" /> </asp:GridView> label显示的结果吗?不是的话 截取字符串或 css设置过长...代替 用样式,GridView的html代码其实是一个表格,你能通过CSS控制table的样式即能控制gridview的样式 设置为不允许换行啊Wrap 设置成 false itemstyle正常换行 GridView1.Attributes.Add("style", "word-break:keep-all;word-wrap:normal"); //自动换行 GridView1.Attributes.Add("style", "word-break:break-all;word-wrap:break-word"); 在IE6网页严重变形,在IE7,8,FF下面显示正常 linq 基本问题,求教 很久都没解决的问题,来这里希望高人指点 我的第一步在哪 ? 求一个新闻录入和显示格式的方法! 有两个问题,大家帮我解决一下!谢谢! 高手求救,.net下用ODBC访问MySQL数据出错 请问如何将从数据库中的数据提出后形成HTML文档 我关注的问题,应该也是入门的重大问题 如何让DataGrid每6行就产生一个分隔呢? 第一次提问,大家帮帮忙,关于AspxGridView的。 关于MessageBox.Show的灵异事件
<Columns>
<asp:TemplateField HeaderText="账号">
<ControlStyle Width="100px" />
<ItemTemplate>
<asp:Label ID="lbID" runat="server" Text='<%# Bind("EmpID") %>'></asp:Label>
</ItemTemplate>
<FooterTemplate>
<asp:TextBox ID="txtID" runat="server"></asp:TextBox>
</FooterTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="姓名">
<ControlStyle Width="100px" />
<ItemTemplate>
<asp:Label ID="lbRealName" runat="server" Text='<%# Bind("EmpRealName") %>'></asp:Label>
</ItemTemplate>
<FooterTemplate>
<asp:TextBox ID="txtRealName" runat="server"></asp:TextBox>
</FooterTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="性别">
<ItemTemplate>
<asp:Label ID="lbSex" runat="server" Text='<%# Bind("EmpSex") %>'></asp:Label>
</ItemTemplate>
<FooterTemplate>
<asp:DropDownList ID="ddlSex" runat="server">
<asp:ListItem Value="男">男</asp:ListItem>
<asp:ListItem Value="女">女</asp:ListItem>
</asp:DropDownList>
</FooterTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="住址">
<ControlStyle Width="200px" />
<ItemTemplate>
<asp:Label ID="lbAddress" runat="server" Text='<%# Bind("EmpAddress") %>'></asp:Label>
</ItemTemplate>
<FooterTemplate>
<asp:TextBox ID="txtAddress" runat="server" Width="80px"></asp:TextBox>
<asp:Button ID="btnAdd" runat="server" Text="添 加" OnClick="btnAdd_Click" />
<asp:Button ID="btnCancel" runat="server" Text="取 消" OnClick="btnCancel_Click" />
</FooterTemplate>
</asp:TemplateField>
</Columns>
<HeaderStyle BackColor="Azure" Font-Size="12px" HorizontalAlign="Center" />
<RowStyle HorizontalAlign="Center" />
<PagerStyle HorizontalAlign="Center" />
</asp:GridView>
不是的话 截取字符串
或 css设置过长...代替
Wrap 设置成 false
正常换行
GridView1.Attributes.Add("style", "word-break:keep-all;word-wrap:normal");
//自动换行
GridView1.Attributes.Add("style", "word-break:break-all;word-wrap:break-word");