// REPORT query statement
Private string querysql = "select * From baobiaoxinxi where report name = '" + baobiaomingcheng + "'";
// Number of fields in the main report
Private int mainreportsfieldcount = 13;
Protected void gridviewxinxilan_rowdatabound (Object sender, gridviewroweventargs E)
...{
For (INT I = 2; I <= mainreportsfieldcount; I ++)
...{
E. Row. cells [I]. Text = "<nobr>" + E. Row. cells [I]. Text + "</nobr> ";
}
}
I started from 2 because there is a selection and deletion box in front.
Test passed!
The above may sometimes cause problems, for example, when reading its value, there will also be <nobr>
Below is the replacement code to complete the above functions.
For (INT I = 2; I <= mainreportsfieldcount; I ++)
...{
// E. Row. cells [I]. Text = "<nobr>" + E. Row. cells [I]. Text + "</nobr> ";
E. Row. cells [I]. Wrap = false;
}
// Hide the primary key column
E. Row. cells [mainreportsfieldcount + 1]. Visible = false;