PC客户端开发研究者---爱生活,爱code!

DataGridView中添加一行时自动生成序列行,未实现

     dataGridView1.DataSource=DAL.SqlHelper.ExcuteDataTable(sqlStr);
            //----------------------------DataGridView添加一行时自动生成序列行,未实现
           int count = dataGridView1.Columns.GetColumnCount(DataGridViewElementStates.Displayed);
            int linecount = dataGridView1.RowCount-1;
            //dataGridView1["Column1", 3].Value = 444;
            for (int i = 0; i < 3; i++)
            {
                dataGridView1["Column1", i].Value = 555;
            }
            //dataGridView1["PCID", 4].Value = 333;
             Console.WriteLine(linecount + "-----" + count);
            //-----------------------------------------

posted @ 2013-03-15 14:00  xxiaoye  阅读(317)  评论(0编辑  收藏  举报