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



MaintenanceFormToolStrip UasgeExpand / Collapse
Author
Message
Posted 04/28/2006 10:15:32 AM
StrataFrame Beginner

StrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame Beginner

Group: Forum Members
Last Login: 01/02/2008 1:46:14 PM
Posts: 22, Visits: 35
I have a SF form that I added a MaintenanceFormToolStrip to.  I want to use the maintenance buttons (New, Edit, Save, etc.) but not the naviagtion buttons which I have turned off.  Instead I want to use a ListView control for navigation.  Everything works fine except for the refreshing/updating of the listview.  How can I keep the listview in sync with the maintenance that is being performed?  Call the requery method on the listview?  At what point?

Thanks!!

Post #999
Posted 04/28/2006 10:27:42 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 1:09:23 PM
Posts: 2,686, Visits: 1,888
You'll need to refresh the list view whenever the data within the business object changes. What I would do is add a handler to the AfterSave event of the business object on the form and call ListView.Requery() in there.

Within the list population, you might look at using the CopyDataFrom method for the business object rather than pulling the data from the database every time. If you do that, then you can Requery() the ListView as often as you want without worrying about roudtrips to the database. You'll be able to put a Requery() in the Navigated event and possibly even the FieldPropertyChanged event (you'll have to configure your business object to have changed events in the BOMapper and rebuild the partial class before you'll see that event on your business object).


www.bungie.net
Post #1000
Posted 05/01/2006 7:42:47 AM
StrataFrame Beginner

StrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame Beginner

Group: Forum Members
Last Login: 01/02/2008 1:46:14 PM
Posts: 22, Visits: 35
Thanks Ben.  The requery works fine but I have another problem that I can't figure out and maybe you can help.  When I perform the requery I programatically select the item in the list I want highlighted.  That works fine.  But if the selected item is not within the viewable portion of the list, the scroll position is not chantged to allow the selected item to be in the display window.  How can I scroll the listview to insure the selected item is in the displayable portion of the control?  Here's my code:

Private Sub AttendingsBO_AfterSave(ByVal e As MicroFour.StrataFrame.Data.AfterSaveUndoEventArgs)   Handles AttendingsBO.AfterSave

Me.lvAttendings.Requery()

Dim strKey As String

Dim intX As Integer

strKey = Me.AttendingsBO.CurrentRow.Item("OPH_ID")

For intX = 0 To Me.lvAttendings.Items.Count - 1

If Me.lvAttendings.Items(intX).SubItems(1).Text = strKey Then

Me.lvAttendings.Items(intX).Selected = True

Me.lvAttendings.Select()

Exit For

End If

Next

End Sub

Post #1015
Posted 05/01/2006 8:34:52 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 1:09:23 PM
Posts: 2,686, Visits: 1,888
Hi Frank,

Glad that worked for you. To get the list view to scroll to that record, you need to put this line of code after you select the row:

Me.lvAttendings.EnsureVisible(intX)

Put that right before the Exit For, and the ListView will scroll to that record and make sure that it is visible.


www.bungie.net
Post #1017
Posted 05/02/2006 9:42:15 AM
StrataFrame Beginner

StrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame Beginner

Group: Forum Members
Last Login: 01/02/2008 1:46:14 PM
Posts: 22, Visits: 35
Dahhh!!!  Don't know how I missed that property.  Thanks!!
Post #1051
Posted 05/02/2006 9:56:48 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 1:09:23 PM
Posts: 2,686, Visits: 1,888
I didn't know it was there until Trent pointed it out one day


www.bungie.net
Post #1052
« 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 8:25am

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.