StrataFrame Forum

Listview Navigation

http://forum.strataframe.net/Topic2634.aspx

By Michael Reese - 9/4/2006

When I use the following code to navigate from the toolbar, I get an error (recordID) which is the primary key of my table is zero. Everything works fine if the table has records.

Michael

Private Sub BO_Navigated(ByVal e As MicroFour.StrataFrame.Business.NavigatedEventArgs) Handles BuildTypeBO1.Navigated

  SetListViewIndex(BuildTypeBO1.RecordID)

End Sub

By StrataFrame Team - 9/5/2006

If there are no records, then accessing any strong-typed property will throw an error.  The easiest way to avoid this is to test on the count of the business object like this:

If BuildTypeBO1.Count > 0 Then
    SetListViewIndex(BuildTypeBO1.RecordID)
End If

By Michael Reese - 9/5/2006

Thanks, that worked.
By StrataFrame Team - 9/5/2006

Glad to hear it Smile