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

Rad Grid Issues

1 Answer 60 Views
Grid
This is a migrated thread and some comments may be shown as answers.
SchaF
Top achievements
Rank 1
SchaF asked on 26 Jun 2013, 05:13 PM
Im trying to figure something out here with my RadGrid, but cant seem to find it. Basically, I need to have a rad grid, where when the pages loads, I go off to the DB to grab 3 things, with the 3rd object being what populates the grid. This object will be a generic DataSet, because the return fields will always be different, depending on some passed in fields.

So the way I have it now, is on the Page_Load, it goes off to the database to get what I need and then stores the 3rd object in a Session variable. Then when the gridView's NeedDataSource event fires, I grab the variable from the Session.Key and then set the datasource to this dataset.

When I click on edit, it fires up the NeedDataSource event again and grabs it from the Session.Key and sets the DataSource again. The fields are then displayed to me, I edit them and hit update, then it again fires the NeedDataSource, and sets the DataSource and my changes to the grid are gone (where and how are these changes saved and stored?). How can I set it so I save these changes to the grids datasource and eventually save/update them to that object I have in the Session, which I can then use a Save button to send it all to the DB and save it.

Basically here is what I want to do. Go to the database and grab my dynamic dataset. When it comes back, bind this to the datagrid and use one of my other objects from the original call to make some fields editable, maxfield length, min field length, numeric only etc. Then when they click update, I want it to update the grid, but not have to make a trip to the database to save it row by row. I want to be able to make a bunch of changes to the grid and then save them all to the database at once by clicking a button.

I have tried setting the EditMode to batch, but its not recognized so it doesnt work. The only options I get are EditForms, InPlace, Popup.

Any help of any kind is appreciated. Examples would be best, but again anything is helpful.

1 Answer, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 01 Jul 2013, 07:45 AM
Hello,

You could find similar approach to your implemented in this code-library project. The approach uses DataTable object which stores the changes locally and then on a button click synchronizes the database with the DataTable object.

Regards,
Andrey
Telerik
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 the blog feed now.
Tags
Grid
Asked by
SchaF
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Share this question
or