Strongly-Typed Binding for List Controls
page 5 of 5
by J. Ambrose Little
Feedback
Average Rating: 
Views (Total / Last 10 Days): 24515/ 35

Conclusion

As mentioned, I'm not entirely certain whether or not going to all this trouble is worth the effort, particularly when just using the BindToListControl method (since something like that can easily be implemented without strong-typing).  It may be that only hard-core middle-tier purists will appreciate the architecture; however it does illustrate (albeit quietly) the ease with which you can bind custom business object collections to data controls, which I think is a really great feature of .NET.

It also offers, as you might expect, a fairly decent separation of UI from the data.  This could easily be abstracted to use other data sources using the IDb interfaces.  And it would not be hard to offer simpler parameter addition if it's found that the event handler option is not usable.  It also lends itself easily to plopping the collection into a cache of some sort for reuse and ease of binding.

Again, let me know what you think, either by feedback, rating, or at the related post on my blog.  I appreciate any insight on how this concept might be expanded or modified to be more usable in day-to-day application development.


View Entire Article

User Comments

Title: Well done. Very useful   
Name: Leo
Date: 2009-02-24 8:31:10 AM
Comment:
Hi J. Ambrose Little,

Thanks for your code. I found it very useful indeed.
I used it in a scenario where I needed to create a NameValuePair Collection to concatenate two fields before displaying it on a DropDownList. Without your approach I would have to retrieve an concatenate column field just for my business object in one specific dropdown.

I am using CSLA as framework for the Business Objects. I am looking forward to make it generic with my objects as is not suitable for me use your FillFromDb, because this data is already manipulated by my objects in a business layer.
Unfortunatelly I could not understand the BuildingParamters as I found quite hard to understand events with delegate, etc.

If you have experience with CSLA and have any suggestion to make the Fill up in a generic manner, please let me know.

Thanks a lot.






Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-04-19 9:20:05 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search