O Opprend Member Joined Nov 5, 2013 Messages 8 Programming Experience Beginner Nov 17, 2013 #1 How to write this statement: ? If datagridview1 is not empty then .... End if Thank you. Edit: My apologies. I posted in the wrong forum. This is my second mistake. I'll make sure not to remake it again. Last edited: Nov 17, 2013
How to write this statement: ? If datagridview1 is not empty then .... End if Thank you. Edit: My apologies. I posted in the wrong forum. This is my second mistake. I'll make sure not to remake it again.
I IanRyder Well-known member Joined Sep 9, 2012 Messages 1,130 Location Healing, NE Lincs, UK Programming Experience 10+ Nov 18, 2013 #2 Hi, You can check the Rows.Count property of the DataGridView to check if you need to do something with it. i.e:- Assuming that you have a header and you allow adding new rows then you can say:- If DataGridView1.Rows.Count > 1 Then 'This means that the DataGridView Has Some Rows, so do something End If Hope that helps. Cheers, Ian Last edited: Nov 18, 2013 Upvote 0 Downvote
Hi, You can check the Rows.Count property of the DataGridView to check if you need to do something with it. i.e:- Assuming that you have a header and you allow adding new rows then you can say:- If DataGridView1.Rows.Count > 1 Then 'This means that the DataGridView Has Some Rows, so do something End If Hope that helps. Cheers, Ian
O Opprend Member Joined Nov 5, 2013 Messages 8 Programming Experience Beginner Nov 19, 2013 #3 Thank you very much Upvote 0 Downvote