This is a migrated thread and some comments may be shown as answers.

NHibernate.Linq, IQueryable, and Viewmodels

1 Answer 124 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Don Cote
Top achievements
Rank 1
Don Cote asked on 11 Aug 2010, 02:42 PM
I have a scenario where I use NH.Linq to access data, returning and IQuerable which I then bind to the Telerik Grid and it handles paging and sorting and filtering and all of that.  A situation arose where I'm going to need to integrate another data type in to the grid and the solution there would be a common view model between the two grid types.

What I'd like to do is convert my entities to a view model prior to it getting to the aspx page -- so it would only pull down the records that I need by virtue of the DataSource/IQueryable, but then I could shape the data as needed by converting it to a view model prior to populating the grid in the aspx page.

Is there anything I can hook in to so as to accomplish this?

Thanks
Don

1 Answer, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 16 Aug 2010, 08:48 AM
Hello Don,

Generally speaking, the creation of the ViewModel should happen before the data is feeded to the actual View/UI layer. Therefore the actual implementation does depend on architecture used and it is not directly related  to out RadGrid control. A basic sample which demonstrates how to achieve similar functionality pattern can be found here.

All the best,
Rosen
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Don Cote
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Share this question
or