StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



Listview NavigationExpand / Collapse
Author
Message
Posted 09/04/2006 11:28:42 AM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 11/22/2008 2:28:31 AM
Posts: 152, Visits: 540

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

Post #2634
Posted 09/05/2006 1:41:05 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: 12/02/2008 4:42:46 PM
Posts: 2,686, Visits: 1,890
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


www.bungie.net
Post #2640
Posted 09/05/2006 2:47:21 PM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 11/22/2008 2:28:31 AM
Posts: 152, Visits: 540
Thanks, that worked.
Post #2641
Posted 09/05/2006 3:09:32 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: 12/02/2008 4:42:46 PM
Posts: 2,686, Visits: 1,890
Glad to hear it


www.bungie.net
Post #2645
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 2:49am

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 0.109. 10 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.