解决方案 »

  1.   

     <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>
      

  2.   

     检查数据长度问题
    substring 换行
    GridView1.Attributes.Add("style", "word-break:keep-all;word-wrap:normal");
      //下面这行是自动换行
      GridView1.Attributes.Add("style", "word-break:break-all;word-wrap:break-word"); 
      

  3.   

    是啊  我也是这么做的
    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();
                }好像没起作用