Print Page | Close Window

[SOLVED] Using ListConverters Within an Injected Presenter

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=460
Printed Date: 11-Jun-2026 at 6:01pm


Topic: [SOLVED] Using ListConverters Within an Injected Presenter
Posted By: Linguinut
Subject: [SOLVED] Using ListConverters Within an Injected Presenter
Date Posted: 01-Oct-2007 at 5:39pm

Hey CAB Afficionados!

Got another research item. 
 
How do I utilize the ListConverters in a view control that has the presenter injected (syntax) and does not inherit from ControlViewPresenter (inheritance)?
 
The presenter of my new control view with a toolbar is not inheriting from ControlViewPresenter (perhaps, it should, somehow), so it is not getting the SetBindingListConverter method.  It inherits from AppViewPresenter.  To see what I mean, try adding a ListConverter to a GridViewControl.  It has the same basic inheritance as my new view.
 
Bill



Replies:
Posted By: Bill Jensen
Date Posted: 02-Oct-2007 at 10:37am
The presenter for any view showing loose controls bound using a DevForce ControlBindingManager should inherit from ControlViewPresenter.
 
Bill J.


Posted By: Linguinut
Date Posted: 02-Oct-2007 at 11:10am

Ok.  How do I get the control view (based on the exact same inheritance schema of the grid view) to inherit from the ControlViewPresenter?

Obviously, I will go to work on this myself.  If I discover the proper path, I will relate it here.
 
 


Posted By: Linguinut
Date Posted: 02-Oct-2007 at 11:58am
Instead of my ControlViewWithToolbarPresenterBase inheriting from AppViewPresenter, I changed it to inherit from ControlViewPresenter (which has AppViewPresenter in its own linkage).  That created an avalanche of changes to my classes in order to re-accomodate the inheritance.  It would not be prudent to list them all here...let's just say, there were a lot of things changed.
 
Now, to test these changes against my app...then to add ListConverters. 
 
Stand by.


Posted By: Linguinut
Date Posted: 02-Oct-2007 at 12:18pm
The changes flowed through nicely.  The views in my app worked exactly the same as before I made the switch to the ControlViewPresenter inheritance.
 
Ok.  Now, back to my first question.
 
How do I utilize the ListConverters in a view control that has the presenter injected?  Where do I place the code?
 
Example:
 
EntityPropertyDescriptors.AddressMasterPropertyDescriptor descriptors = EntityPropertyDescriptors.AddressMaster;
SetBindingListConverter(descriptors.CarrierMaster, ListConverterNames.CarrierList);
SetBindingListConverter(descriptors.Carrier, ListConverterNames.CarrierIDList);
 
Thanks for any insight here,
Bill


Posted By: Linguinut
Date Posted: 02-Oct-2007 at 12:45pm
Is this just a workaround?
 
I created a new presenter for my AddressView rather than allowing straight injection.  Within that presenter I placed the code I needed for the ListConverters.  That actually works.  However, is it the best, CAB way of doing this? 


Posted By: Bill Jensen
Date Posted: 02-Oct-2007 at 4:03pm
Yes, I think that's the right way to do it.  See also my post on the topic "Binding Combo Boxes".
 
Bill J.


Posted By: Linguinut
Date Posted: 02-Oct-2007 at 4:05pm
Thanks, Bill!  Adding the presenter seemed to make the most sense.



Print Page | Close Window