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

What is the Right approach for CRUD operation using grid.

1 Answer 24 Views
Grid
This is a migrated thread and some comments may be shown as answers.
JD.
Top achievements
Rank 1
JD. asked on 18 Jun 2012, 05:58 AM
Hi,

For example sake:  Lets take Orders table or Customers table or any table.

What i believe is in most of the cases, the grid is not used to display data from Orders table directly.  Its always a view table eg. vOrders
Where vOrders connects to various other tables and data is displayed in grid.   this means that any feature of automatic insert/update will not be of useful,  also a grid might just display few columns that are needed , but while editing or inserting it needs all columns that are present in Orders table and not of vOrders. which means during edit/insert  I need to query main orders table (single row by querying a particular OrderID)

Is there a live example to demonstrate this.

The only way I could see is using "Custom Control.ascx", but the related examples are a bit confusing , because it just passes current reocord to customcontrol as "dataitem"  and then after insert/update the main aspx page queries control for individual values and proceeds with action.   so there is very much tight dependency on aspx and ascx.   (makeing it difficult to reuse .ascx  elsewhere)

I wish to learn what approach other developers have taken or recommend me.  It would be nice if telerik team gives some good suggestion/knowledge .


Regards

1 Answer, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 21 Jun 2012, 06:27 AM
Hi,

Automatic datasource operations as their name suggests are operations that are more dependent on the datasource than on the databound control that is used. The databound control is used only to provide that values for the fields that are presented in the datasource.

Keeping this in mind, if the datasource is capable of inserting in multiple tables simultaneously then the databound control that is bound to this datasource would be capable too.

You could check this help topic for more information on how you could encapsulate CRUD operations over VIews.

Greetings,
Andrey
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
JD.
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Share this question
or