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

Why is this so hard?

1 Answer 99 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Per
Top achievements
Rank 1
Per asked on 01 Jul 2009, 07:09 AM
Hi!

I have been working for 2 days now trying to solve a basic "2 way binding" problem but I'm about to give up.
Is this possible with todays RadGridView?

We are working on a enterprise application with a n-tire layer architecture.

Data Access Layer
Business Logic Layer
GUI

The Data Access Layer is using Linq2SQL to get the data from the database and then passes the linq objects to the business layer and then the gui layer.
In the gui layer we have a RadGridView.

The RadGridView is readonly from start.
After the user clicks on a "Start edit" button, the RadGridView can be edited.

I want the user to be able to edit fields, remove rows and add new rows but nothing should be changed in the database until the user presses the button "Save changes".

Can this be done?
Can someone please send me a "best practice" example for this, I cannot be the only one looking for this?

Regards,
Per Bornsjö

1 Answer, 1 is accepted

Sort by
0
Jordan
Telerik team
answered on 03 Jul 2009, 12:11 PM
Hi Per,

Most of the two way binding implementations out there are "online", i.e. the changes are saved back to the binding data source immediately. The way I see it you will need to use a transaction in the following way.
1. open a transaction when the user clicks the "Start edit" button
2. commit the transaction when the user clicks the "Save changes" button
3. you could add a "Cancel changes" button (if you don't have one already) and when the user clicks it, rollback the transaction

If you have trouble implementing transactions with Linq2SQL you could take a look at our Open Access ORM tool, and specifically this help article.


Regards,
Jordan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
GridView
Asked by
Per
Top achievements
Rank 1
Answers by
Jordan
Telerik team
Share this question
or