日期:2014-05-17 浏览次数:21072 次
DataTable dt = new DataTable();
dt.Columns.Add("M_name", typeof(string));
dt.Columns.Add("M_number", typeof(string));
dt.Columns.Add("开关箱尺寸", typeof(string));
dt.Rows.Add("滚到", "12", "");
dt.Rows.Add("送辊", "1", "");
dt.Rows.Add("滚辊道到", "162", "");
this.dataGridView1.DataSource = dt;
for (int i = 0; i < this.dataGridView1.Rows.Count; i++)
{
DataGridViewRow g = this.dataGridView1.Rows[i];
if (g.Cells["M_name"].Value != null && g.Cells["M_name"].Value.ToString().Contains("辊道"))
{
if (g.Cells["M_number"].Value != null)
{
if (Convert.ToInt32(g.Cells["M_number"].Value) > 15)
{
g.Cells["开关箱尺寸"].Value = "800*400*1200";
}
else
{
&nb