日期:2014-05-18 浏览次数:20521 次
foreach (GridViewRow grow in GridView1.Rows) { TextBox textbox = (TextBox)grow.Cells[4].FindControl("TextBox2"); textbox.Text = textbox.Text.Trim(); }
foreach (Control control in GridView1.TemplateControl.Controls) { if (control is TextBox) { TextBox textBox =(TextBox)control; textBox.Text = textBox.Text.Trim(); } }
foreach (Control control in Controls) { foreach (Control c in pControls) { foreach (Control childc in c.Controls) { if (childc is TextBox) { TextBox textBox = (TextBox)childc; textBox.Text = textBox.Text.Trim(); } } } }
TextBox6.Text = e.Item.Cells[7].Text.Trim().Replace(" ", "");
------解决方案--------------------
这个应该是你数据库的问题吧,你应该把字段设为varchar可变长型,而不是char定长型