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

RIA Services EntitySet + MVVM + RadGridView Add/Delete Row

2 Answers 143 Views
GridView
This is a migrated thread and some comments may be shown as answers.
joao rodrigues
Top achievements
Rank 1
joao rodrigues asked on 18 May 2010, 07:29 PM
Hi,

I've checked the sample code for using Ria Services with RadGridView Adding new rows to database via RIA services

Yet, this approach does not seam very MVVM like.

In my case, the ViewModel Publishes the EntitySet<T> as an IEnumerable that is returned from DataContext.

I understand that IEnumerable is not an IList but I still need the Add, Delete,... functionality from RadGridView.

I don't want to use the .ToList since that one copies the objects outside the EntitySet as far as I know.

I have thinked about ObservableCollection ["new ObservableCollection<T>(EntitySet)"] but don't know if is the right way to do it...

Can someone point me to what should I use to wrap the EntitySet (in ViewModel) for binding to RagDrigView and maintain the functionalities  above (add row, delete row...)?


Thanks,
Joao Rodrigues

2 Answers, 1 is accepted

Sort by
0
Accepted
Stefan Dobrev
Telerik team
answered on 19 May 2010, 11:14 AM
Hello joao,

This forum thread has an example that illustrates how this can be achieved.

Greetings,
Stefan Dobrev
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.
0
joao rodrigues
Top achievements
Rank 1
answered on 20 May 2010, 10:45 AM

My fault, I should search a little more.

Thank you Stefan.
Tags
GridView
Asked by
joao rodrigues
Top achievements
Rank 1
Answers by
Stefan Dobrev
Telerik team
joao rodrigues
Top achievements
Rank 1
Share this question
or