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

Save multiple rows

1 Answer 40 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Dmitry
Top achievements
Rank 1
Dmitry asked on 26 Jan 2012, 09:47 PM
Hello,
I started a new project and using your OpenAccess library just as you did in "WPF MVVM with OpenAccess" sample solution form OpenAccess SDK. AddCommand works fine when I add a single record. But when I try to add multiple records, ViewModel saves only recent inserted item. How do I savе multiple new records?
Thank you.

1 Answer, 1 is accepted

Sort by
0
PetarP
Telerik team
answered on 31 Jan 2012, 06:44 PM
Hello Dmitry,

 You will need to store each and every new instance in a list that will later be persisted. That said every time you try to insert a new entry you will need to move the current one into a list of entities to persist. Once you click save you will have to call context.Add(entities) instead of context.Add(SelectedItem). This way you will insert all of your new entities.

All the best,
Petar
the Telerik team

SP1 for Q3’11 of Telerik OpenAccess ORM is available for download

Tags
GridView
Asked by
Dmitry
Top achievements
Rank 1
Answers by
PetarP
Telerik team
Share this question
or