DataGridView RowCount vs Rows.Count

Viewed 60361

If I have a DataGridView uxChargeBackDataGridView.

Are the following syntactically different but effectively the same?:

int numRows = uxChargeBackDataGridView.Rows.Count;
int numRowCount = uxChargeBackDataGridView.RowCount;

If uxChargeBackDataGridView is empty then both are equal to 1; does it therefore logically stand that if either of these is equal to 1 I can assume the user has not input any data?

My WinForms application has a button named RUN - could I use the above test to decide if this button is enabled or not i.e only enable the button when the number of rows is > 1 ?

6 Answers

IsNewRow probably can solve mystery. It can give the meaning of 1. If IsNewRow is true created but there is nothing in it and not registered. If IsNewRow false you have got 1 row filled full or partially. I hope this is right for you.

Related