Hello,
I am using Vb.net.
I have a datagridview1 in winform for adding product, quantity, rate, amount, etc.
I have other textboxes for Customer Name and Address.
The data is saved with a button - SAVE.
I have a code to check if any textbox is empty as -
This code works well.
I want a code if someone accidently click SAVE button before adding Product, there should be message as "Please add product."
I have tried code - DataGridView1.Rows.Count=0, DataGridView1.Rows.Count < 1, datagridview1.rowcount=0
but they do not work.
Thanks.
I am using Vb.net.
I have a datagridview1 in winform for adding product, quantity, rate, amount, etc.
I have other textboxes for Customer Name and Address.
The data is saved with a button - SAVE.
I have a code to check if any textbox is empty as -
VB.NET:
If TxtCustomerName.Text = "" Or TxtAddress.Text = "" Then
MsgBox("Please fill all record.")
Exit Sub
End If
I want a code if someone accidently click SAVE button before adding Product, there should be message as "Please add product."
I have tried code - DataGridView1.Rows.Count=0, DataGridView1.Rows.Count < 1, datagridview1.rowcount=0
but they do not work.
Thanks.