How Can I Populate my ListView from the Results of a Browse Dialog


Author
Message
Marcia G Akins
Marcia G Akins
Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
The title says it all. Is there a simple way to let the browse dialog populate my listview?

Thanks!

Replies
Marcia G Akins
Marcia G Akins
Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
Greg McGuffey (10/09/2008)
I'm not super familiar with the BrowseDialog, but I'm guessing you'd drop a BO of the appropriate type on the form, drop a browsedialog on the form, setup the browse dialog to populate that BO when the user selects something, then setup the listview to CopyDataFrom that BO. Finally, handle the BO's CurrentTableRefilled event and requery the listview.

Hope that heads you in the right direction (or is so wrong somebody smarter will quickly correct me Pinch )

The browse dialog is working just fine. I have the ListView set up as bound to the same BO that the browse dialog is populating. But listview does not get populated. The Requery() method wants to call a method on the BO to populate it but that BO has already been poulated by the browse dialog Rolleyes  I just want to tell the listview to go populate itself from the BO that was populated by the browse dialog.

Thanks for trying to help.

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
You need to set the MethodToExecute to CopyDataFrom, use the business layer version.



Setup handler on CurrentTableRefilled on the BO in question, call requery of listview.



Add handler for the listview's ListPopulating and set the two params needed for CopyDataFrom, the first is the BO the second is an enum indicating how to fill listview from bo.



Of course, if the datagridview is working, you might not want to mess with it, but it is very easy to populate a listview from a BO...once you figure it out! BigGrin

Marcia G Akins
Marcia G Akins
Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
Greg McGuffey (10/09/2008)
Of course, if the datagridview is working, you might not want to mess with it, but it is very easy to populate a listview from a BO...once you figure it out! BigGrin

My philosophy is "if it ain't broke, don't fix it Tongue

But I will keep your exellent advice handy for the future.

Thanks again.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search