int colIndex = 2; int notNullRows = this.dataGridView1.Rows.OfType() .Count(r => r.Cells[colIndex].Value != null);
楼主会了么,能教一下么