日期:2014-05-17  浏览次数:20813 次

DataTable 0处没有任何行

 
private DataTable GetSelIDlists()
        {
 
            DataTable dt = new DataTable();
            bool IsCheck = false;
            int count = this.PdGridView.RowCount;
            for (int i = 0; i < count; i++)
            {
                if ((bool)(((DataGridViewCheckBoxCell)this.PdGridView.Rows[i].Cells[0]).EditedFormattedValue) == true)
                {
                    dt.Rows[i][0] = this.PdGridView.Rows[i].Cells["pname"].Value.ToString();
                    dt.Rows[i][1] = this.PdGridView.Rows[i].Cells["pmade"].Value.ToString();
                    dt.Rows[i][2] = this.PdGridView.Rows[i].Cells["poutprice"].Value.ToString();
                    dt.Rows[i][3] = this.PdGridView.Rows[i].Cells["Column1"].Value.ToString();
                    dt.Rows[i][4] = this.PdGridView.Rows[i].Cells["spname"].Value.ToString();
                    dt.Rows[i][5] = this.PdGridView.Rows[i].Cells["flag"].Value.ToString();
                    dt.Rows[i][6] = "1";
                    dt.Rows[i][7] = this.PdGridView.Rows[i].Cells["flag"].Value.ToString();
                    IsCheck = true;
                }
 
            }