Tuesday, 9 October 2012

C# Datagridview rows count

This post to help to know to find the ow many rows are in datagridview ..

textBox1.Text = dataGridView1.Rows.Count.ToString();

Same time in your datagridview have "add new row" is enable then you have to use like that,

textBox1.Text = (dataGridView1.Rows.Count - 1).ToString()

No comments:

Post a Comment