GridView 不换行

//在GV1_DataBound事件中加上:

  protected void GV1_DataBound(object sender, EventArgs e)
        {
            try
            {

for (int j = 0; j < GV1.Rows.Count; j++)
                {
                     for (int i = 0; i < GV1.HeaderRow.Cells.Count - 1; i++)
                    {
                        GV1.Rows[j].Cells[i].Text = "<nobr>" + GV1.Rows[j].Cells[i].Text + "</nobr>";
                    }
                }

 

       }

catch

{

}

}

 

posted @ 2014-01-12 12:22  BB林业  阅读(223)  评论(0编辑  收藏  举报