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

How can i save Radgrid data in database directly

4 Answers 327 Views
Grid
This is a migrated thread and some comments may be shown as answers.
shivesh
Top achievements
Rank 1
shivesh asked on 11 Nov 2010, 08:48 AM
hi,
anybody give me sample example where i am able to learn how can i save radgrid data to database directly with javascript .
here i am using a dropdown textbox and label for my redgrid.
Thanks

4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 11 Nov 2010, 10:16 AM
Hello Shivesh,


RadGrid for ASP.NET AJAX supports client-side binding to web services or page methods as demonstrated in the online demo. In order to assign data source for the grid and refresh its state on the client, utilize the set_dataSource(dataSource) and dataBind() methods from its client-side API.

Check this demo for more information.
Grid / Client-side Insert/Update/Delete



-Shinu.
0
Marin
Telerik team
answered on 11 Nov 2010, 10:57 AM
Hello shivesh,

You can also check this help article showing further information on how to perform CRUD operation client-side:
http://www.telerik.com/help/aspnet-ajax/client-update-insert-delete.html

Greetings,
Marin
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
shivesh
Top achievements
Rank 1
answered on 11 Nov 2010, 11:42 AM
Hi Marin,
Thanks for your quick response  but here i am inserting from radgrid not from outside from radgrid in yr demonstration inserting records from
outside radgrid here my radgrid generating row on user click button then generate new row so tell me how can i insert and update database
table from radgrid.
may we use session or view state.
thanks
0
Marin
Telerik team
answered on 15 Nov 2010, 09:17 AM
Hi shivesh,

You can also do this from inside the grid. The concept is pretty much the same: first you retrieve the values client-side and then call a method to perform the database operations.  Have a look at the Client side API reference. There you can find useful methods like: updateItem and insertItem etc. Also have in mind that when using client-side binding the argument passed as a datasource should be JSON serializable also in this approach binding is supported only for web services and page methods.
Viewstate and Session properties can only temporarily hold key-value pairs you still have to persist the data to the database at some point. More standard approach is the server side-binding where you can use automatic operations and let the datasource manages persistance of the data.

Sincerely yours,
Marin
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
shivesh
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Marin
Telerik team
shivesh
Top achievements
Rank 1
Share this question
or