Hi
I'm rather new to .Net: what is the best way to link persistent domain objects with data-aware visual controls
What I'm trying to do is to use a rich domain model, get an O/R mapping tool/framework (e.g. NHibernate) to take care of persistence but still be able to use Girds and other DB controls.
Any help would be greatly appreciated.
Andrei.

O/R Mapping and visual controls
bbodine1
When binding to a dataset you actually bind to a tables defaultview object which is the one with capabilities of sorting and filtering.
For List<Product> there is both sort and filtering (findall) but they both use some kind of strategy object (delegegate for find and IComparable objected for sort) so using them in data binding differs a bit between windows forms and web. What are you specifically looking for
Gary7
Yes,
DataSets do not know about the store where the data came from or any additional data that is left there. Only about the data it already have in memory.
Karthick Sukumaran
Once again, thanks a lot for you help. I really appreciate it.
Andrei
Michael Hansen
As I said I'm rather new to .Net so perhaps the answer to my question is quite obvious...
Let's say we have a class Person
class Person
{
public String Name;
}
which has NHibernate mapping and can be loaded / persisted from/to DB. How would you get it displayed in a grid (I mean one obvious and very naive solution would be to manually load the whole table and insert it in to a Grid). It gets even more tricky if we take some 3d party Grid implementation with sorting, filtering and such.
I guess it all can be done by implementing custom DataSet, but I was wondering if that scenario has been covered by one of O/R M frameworks. The frameworks I've looked into (except for AgileStuido, which doesn't seem to be supported) do not elaborate on connecting to visual components so I've assumed they don not provide this link.
Thanks
Andrei
A.Kahn
I'm looking for a solution for Windows Forms. I've got almost everything clear now (thanks to you). One thing that still concerns me is how sorting, filtering and scrolling would work on a large dataset. Say we have 100.000 rows in the person table - I guess the only way to sort,filter or scroll through it would be to load all 100.000 from DB Otherwise I can't imagine how to sort it using comparable. Is that right
Thanks a lot, you are a great help!
Andrei
jeje1g
If you have 100.000 records you would have the same problem with datasets that you do with List<>. You need to create the logic yourself to fetch only the data you want to display. Traditionally that is done by just calling for a subset of rows in your SQL-statement
SrinSree
Thanks
Andrei
Mystagogue
Randy Trahan
It need to be a property instead of a field. But you display it in the same way as you do with datasets. You feed the grids DataSource property with a list fo Persons and it will be displayed (for example a List<Person>)