var count = this.dataGridViewArticles.Rows.Cast().Count(); var countjustX = this.dataGridView1.Rows.Cast() .Count(row => row.Cells["RisFin"].Value == "X"); this.textBox1.Text = count.ToString();