Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Specified grid columns vs. the default BO data columns..
Message
 
To
15/04/2008 23:49:03
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01310982
Message ID:
01311325
Views:
15
Matt,

>I have studied the example in the Jump Start on specifying which columns to display from the BO in a mmDataGridView, and I have a little issue here...
>
>Obviously, we want to do as little work in the UI objects as possible, and shove more of the coding effort into the BO, so that if I re-create my app in WPF or ASP or WinForms (or whatever comes out next), it will require as little work as possible to re-write the UI. RIGHT?
>
>Well then, why would the example teach me to hard code all those grid columns to specific data columns, rather than building a BO method for the desired data-column presentation that I want for the grid (i.e. GetWhateverRecords() type methods in the BO that call stored procs). You would need a BO method for that would pull ONLY the columns that I want to display in the grid. That way you could just leave the grid columns alone and let it show all the columns in the BO? The point is that the BO method determines the columns to show, not the UI grid object.
>
>Yes, I might have a few more Get...() calls in my BO to cover all the possible column views that my app will need, but as I re-write the UI in the future to keep chasing all the UI platforms Microsoft keeps coming up with, the BO will be ready.
>
>Plus, if I want to add or remove columns to display in the grid, I change the BO method, not the UI grid object. Isn't this one of the basic premises of this whole "put your logic in the BO not the UI" religion?

You're right in that if you have a grid that potentially displays a large number of records, you should definitely limit the number of columns that are returned from the business object and display those in the grid instead. You will probably still want to specify the columns in the grid anyway, because by default, the column header will display the same text as the associated data column (often not what you want), and you may want to do special formatting of data in the column. We chose (perhaps incorrectly) to make the Jump Start example simpler and display all columns. I'm going to think it through and possibly change the example accordingly.

Best Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Previous
Reply
Map
View

Click here to load this message in the networking platform