[RESOLVED] [2005] Check if Grid Returns Records.?
I have a Combobox Bound to a dataset, and a datagrid that is located on a control in the form i'm working on. If the combo Box is set to Enrolled and the datagrid is Empty, when I click save i want to exit the sub of that click event.
How do I check if there are any rows in a datagrid?
Further explanation:
The combobox is filled with status codes. The user should not be able to pick Enrolled if the datagrid is empty. The datagrid being bound to an employee table. Basically if the employer has no employees we cannot enroll them. Or the user should not be able to give them enrolled status..
Re: [2005] Check if Grid Returns Records.?
Code:
Try
If ComboBox9.Text = "ENR-P" And ctlCall.DsCall1.Tables("Call").Rows.Count = 0 Then
Exit Sub
End If
Catch ex As Exception
End Try
My problem is getting the data from the grid when it's contained in the control
Re: [2005] Check if Grid Returns Records.?
Send Boolean Values to your form from the control
Code:
Try
If Me.DsEmployee1.Tables("Employee").Rows.Count = 0 Then
frmClient.blEmployees = False
Else : frmClient.blEmployees = True
End If
Catch ex As Exception
End Try
Then Evaluate
Code:
If Me.blEmployees = False And ComboBox9.Text = "ENR-P" Then
MsgBox("Status of 'ENR-P' Not Allowed: No Employees", MsgBoxStyle.OkOnly, "Oops!")
Exit Sub
End If