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

Grid - Enter Unbound Information

3 Answers 44 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Todd
Top achievements
Rank 1
Todd asked on 16 Jan 2014, 04:59 PM
I have a grid on a page that displays some basic information about an item, such as item # and description.  I need to be able to allow my users to enter detail information about any item they choose then update a database with those values.  Presently I'm doing this by entering all of my detail fields as textboxes in an ItemTemplate.  Once the user is done entering information they hit a submit button that goes through every row in the table and checks for updates and the updates the database.  While this works, it is very inefficient and actually does fail to work when my server has lots of traffic.  It simply times out.  

For my scenario, what is the proper way to do this?

Thanks.

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 17 Jan 2014, 04:47 AM
Hi Todd,

You can try the Grid - Batch Editing functionality, this can switch grid cells in edit mode by simply clicking them (an easy and intuitive approach), update the data on the client and then process all changes on the server with a single batch update. Have a look into this documentation to know more about Batch Editing.

Thanks,
Princy
0
Todd
Top achievements
Rank 1
answered on 17 Jan 2014, 08:44 PM
I've looked at the example you mentioned and I cannot get it to work.  Everything loads fine, switches into edit mode perfectly, but updating it goes haywire.  The problem I think is that my grid has about 20 fields, some mapped to columns some not used or displayed in any way, but my update procedure only uses about 10 of those fields.  There for everytime I try to submit my changes to the database I get a "Too many parameters" error.  I would like to make this work in the same manner as the example but I'm not sure how to make sure that only the parameters I want are passed.  I have even tried to use the codebehind UpdateCommand procedure to do the updating myself, but I can't seem to access the edited values of the cells.

Can you help with how to update my data given my situation?
0
Accepted
Viktor Tachev
Telerik team
answered on 21 Jan 2014, 09:36 AM
Hello Todd,

In the online demo for RadGrid Batch editing automatic CRUD operations are used. Note that in order for this method to work you need to ensure that such operations are supported by the data source. Moreover automatic operations are supported only when using declarative data source set by DataSourceID property.

Would you share your markup for the RadGrid with the related code-behind so we could have better understanding of your scenario? This would help finding a reason why the data is not updated.

Regards,
Viktor Tachev
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
Todd
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Todd
Top achievements
Rank 1
Viktor Tachev
Telerik team
Share this question
or