Hi,
for now i've added 2 templates (still in developpement though):
first, an entity datagridview, with the following features:
- take a tlist<entity> as input
- display textbox column for string
and numbers
- display checkbox column for boolean
- display combobox
column for FK
- column are readonly depending of the table column
-
TList<entity> properties are generated for FK Combo DataSource
- an
event is thrown when the focus change to a new entity (aka a new row)
-
embedded error provider for automatic validation, based upon the (customizable)
validation rules.
The second template is a form to edit a single entity, and apart from
display, contains the same features.
about your CAB question, my usual way to do this is the following:
first i have a usercontrol for the smartpart, a presenter (actually a class that inherits from Controller) associated to it, and the workitem class.
the State defined in the workitem is a TList, and this state is also defined in the presenter. the view access to the state through the presenter, so in my ui, i do things like: uxDataGridView.DataSource = Presenter.Products;
if i need some filtering on the list, of course the filter form is on the view, so on the filtering button click, i call:
Presenter.FilterProducts( criteria1, criteria2, etc); // you can call different overload depending of the filter form fill
and then i create this method in the Presenter:
internal void FilterProducts(string name, int categoryId) // create as many overload as needed
{
// here you can implete this via access to DataRepository, or even by creating a dotlucene index
Products.RemoveFilter();
Products.ApplyFilter(delegate (Product p) {return p.Name.Contains(name) && p.CategoryId == categoryId})
}
the Products list will be automatically filtered, and as it is binded, your UI display will be automatically updated.
John Roland
------------------------------
Member of the .netTiers team
http://en.serialcoder.net------------------------------