Hi I have the below code which runs when a data card is selected.
How do i stop it from running if the user clicked on the "Add New Record" datacard? Is there a TypeOf record i can refer to?
Private Sub XamDataPresenter1_RecordActivated(sender As Object, e As Infragistics.Windows.DataPresenter.Events.RecordActivatedEventArgs) Handles XamDataPresenter1.RecordActivated
If TypeOf e.Record Is FilterRecord Then Exit Sub End If
' Check to make sure the selected Record is a DataRecord If TypeOf e.Record Is DataRecord Then
' Cast the record passed in as a DataRecord Dim myRecord As DataRecord = CType(e.Record, DataRecord)
myclientname = myRecord.Cells(0).Value.ToString() myclientid = myRecord.Cells(1).Value.ToString()
getclientprogramhistory()
End If
End Sub
The below does the job.
If IsNothing(myRecord.Cells(0).Value) = False Then myclientname = myRecord.Cells(0).Value.ToString() myclientid = myRecord.Cells(1).Value.ToString()
getclientprogramhistory() End If