C# 页面一行数据时变形了,多行的时候不会? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <asp:GridView ID="GridView_clgzxx" runat="server" AutoGenerateColumns="False" Font-Size="9pt" Height="109px" Width="700px"> <RowStyle Height="16px" /> <Columns> <asp:BoundField DataField="xhz" HeaderText="卸货站" > <ItemStyle Height="16px" Width="35px" /> </asp:BoundField> <asp:BoundField DataField="yjddsj" HeaderText="预计到站时间" > <ItemStyle Height="16px" Width="110px" /> </asp:BoundField> <asp:BoundField DataField="sjdzsj" HeaderText="实际到站时间" > <ItemStyle Height="16px" Width="105px" /> </asp:BoundField> <asp:BoundField DataField="lksj" HeaderText="离开本站时间" > <ItemStyle Height="16px" Width="105px" /> </asp:BoundField> <asp:BoundField DataField="ycqk" HeaderText="异常情况" > <ItemStyle Height="16px" Width="140px" /> </asp:BoundField> <asp:BoundField DataField="qrr" HeaderText="确认人" > <ItemStyle Height="16px" Width="40px" /> </asp:BoundField> </Columns> <HeaderStyle Height="16px" /> </asp:GridView> 检查数据长度问题substring 换行GridView1.Attributes.Add("style", "word-break:keep-all;word-wrap:normal"); //下面这行是自动换行 GridView1.Attributes.Add("style", "word-break:break-all;word-wrap:break-word"); 是啊 我也是这么做的if (ds_ycqk.Tables[0].Rows.Count > 0) { txt_fhqdh.Text = ds_ycqk.Tables[0].Rows[0]["fhqdh"].ToString(); txt_clbh.Text = ds_ycqk.Tables[0].Rows[0]["clbh"].ToString(); txt_jsydh.Text = ds_ycqk.Tables[0].Rows[0]["jsydh"].ToString(); txt_fcsj.Text = ds_ycqk.Tables[0].Rows[0]["fcsj"].ToString(); GridView_clgzxx.DataSource = ds_ycqk.Tables[0].DefaultView; GridView_clgzxx.Attributes.Add("style", "word-break:break-all;word-wrap:break-word"); GridView_clgzxx.DataBind(); }好像没起作用 关于界面假死的问题! C#如何测出一个字符串是何种编码 问一个关于DataSet的小问题,在线等待,马上给分! c#皮肤包的问题! 怎样在DataGridView中定位一行 请问:怎么得到DataSet当前的行 .net问题(急,在线等待~) VS 2010 中用于帮助绑定选定项的选项 快捷键是多少 招聘.NET高级软件工程师等技术类职位 转让一套办公自动化软件(OA)的源代码! 修改msg文件的发件人和发件时间。。。。版主帮帮忙~~~~~ winform图片存入sql 2005中和读出显示的问题
Font-Size="9pt" Height="109px" Width="700px">
<RowStyle Height="16px" />
<Columns>
<asp:BoundField DataField="xhz" HeaderText="卸货站" >
<ItemStyle Height="16px" Width="35px" />
</asp:BoundField>
<asp:BoundField DataField="yjddsj" HeaderText="预计到站时间" >
<ItemStyle Height="16px" Width="110px" />
</asp:BoundField>
<asp:BoundField DataField="sjdzsj" HeaderText="实际到站时间" >
<ItemStyle Height="16px" Width="105px" />
</asp:BoundField>
<asp:BoundField DataField="lksj" HeaderText="离开本站时间" >
<ItemStyle Height="16px" Width="105px" />
</asp:BoundField>
<asp:BoundField DataField="ycqk" HeaderText="异常情况" >
<ItemStyle Height="16px" Width="140px" />
</asp:BoundField>
<asp:BoundField DataField="qrr" HeaderText="确认人" >
<ItemStyle Height="16px" Width="40px" />
</asp:BoundField>
</Columns>
<HeaderStyle Height="16px" />
</asp:GridView>
substring 换行
GridView1.Attributes.Add("style", "word-break:keep-all;word-wrap:normal");
//下面这行是自动换行
GridView1.Attributes.Add("style", "word-break:break-all;word-wrap:break-word");
if (ds_ycqk.Tables[0].Rows.Count > 0)
{
txt_fhqdh.Text = ds_ycqk.Tables[0].Rows[0]["fhqdh"].ToString();
txt_clbh.Text = ds_ycqk.Tables[0].Rows[0]["clbh"].ToString();
txt_jsydh.Text = ds_ycqk.Tables[0].Rows[0]["jsydh"].ToString();
txt_fcsj.Text = ds_ycqk.Tables[0].Rows[0]["fcsj"].ToString();
GridView_clgzxx.DataSource = ds_ycqk.Tables[0].DefaultView;
GridView_clgzxx.Attributes.Add("style", "word-break:break-all;word-wrap:break-word");
GridView_clgzxx.DataBind();
}好像没起作用