Synch ListView Control


Author
Message
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
This is a sample of how to use a list view to navigate through the records of a ListView and keep the ListView in synch with the BO. A SF ListView was subclassed to add the synching functionality. See the project for info on how it was done. The project uses the StrataFrameSample db.



Features:

- Fairly easy to setup.

- Handles adding, updating and deleting within the BO

- Selecting an item in the list navigates to that item in the BO.

- Navigation of the BO automatically updates selected item in the list.

- Filling the data table automatically updates the list and synchs it



Usage:

- Drop a BO on the form

- Drop this control on the form

- Setup the columns for the listview (normal SF procedure)

- Setup the Population list settings. The method must be CopyDataFrom using the business layer overload.

- Set the BO of the synch list control



These are the basics. The last step depends on how you will load the BO. In the sample, the BO is simply loaded when the form is loaded. In that case, have the list load when the form is loaded also and be sure the initialization priority of the list to be larger than the priority of the form (the BO needs to be loaded first).



If you load the BO manually, then the list should be loaded manually also. Whenever you load the BO, simply call the UpdateAndSynch() method of the list after loading.



I typically will call the SelectFirstListItem() method after the load in order to make sure that the first item in the list is selected. This could probably be built in, but isn't at this point.



As always, comments/suggestions/improvements are welcome and appreciated!



Greg
Attachments
SynchListExample.zip (430 views, 749.00 KB)
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Greg McGuffey - 17 Years Ago
Edhy Rijo - 17 Years Ago
Greg McGuffey - 17 Years Ago
Trent L. Taylor - 17 Years Ago
                     Great:exclamationmark: Thanks a lot.:P
Edhy Rijo - 17 Years Ago
                         Cool Trent! I look forward to checking it out!
Greg McGuffey - 17 Years Ago
                             [quote][b]Greg McGuffey (03/18/2008)[/b][hr]Cool Trent! I look forward...
Edhy Rijo - 17 Years Ago
                                 Thanks Edhy! I'll check it out :D
Greg McGuffey - 17 Years Ago
                         Sounds Great! So does that mean we do not have the code the listview...
Michael Reese - 17 Years Ago
                             [quote]So does that mean we do not have the code the listview...
Trent L. Taylor - 17 Years Ago
     Soon? :)
Mike Tomlin - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Greg McGuffey - 17 Years Ago
Edhy Rijo - 17 Years Ago
                         No. The files in your Common Files\MicroFour\StrataFrame folder did...
Trent L. Taylor - 17 Years Ago
                             These are the steps I used in the update: Close all instance of VS....
Edhy Rijo - 17 Years Ago
                                 Vista 64bits Installation steps: Accepted Installation suggested...
Edhy Rijo - 17 Years Ago
                                     Edhy, I have tested, on many different 64-bit machines, and the...
Trent L. Taylor - 17 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search