Sexy chatmobil - Radgrid not updating after insert

Here I am looping through the Grid View Rows and checking whether the Check Box is checked for that Row.

If the Check Box is checked then the edited values from the Text Box and the Drop Down List controls are added to the SQL Parameters and the record is updated in the database based on the Customer Id in the Hi, This is Mudassar Khan. Net Question Answer site, specially started to allow visitors of this site ask their doubts and queries. Just click the Ask Now button and ask your question now.

First, create a web-application using Visual-Studio 2005 or later.

radgrid not updating after insert-41

Suppose I have one web page in which I need a to insert, view, update and delete records.

To do that, instead of creating four Stored Procedures to perform these tasks I will create a single Stored Procedure to satisfy my requirements and I will access it in code behind depending on the action performed by the end user on a button click.

To cancel the update operation, set the collections, if necessary, before the values are passed to the data source.

A common way to use these collections is to HTML-encode the values supplied by the user before they are stored in the data source.

I have written this article specially focusing on newcomers and anyone new wants to insert, update and delete records in a Grid View using a Single Stored Procedure, so let us start with a basic introduction.

The comments in the Stored Procedure above clearly explain which block is used for which purpose, so I have briefly explained it again.Now at page load I have called the method, so after that the grid will fill as in: Now click on the Edit button that calls the edit method as shown in the following grid: If you click on the "Cancel" button then the editcancel method will be called and edit mode will be cancelled.Now enter some values into the grid Text Box and click on an update button that calls the update method and then the records in the Grid View will be updated as in: Now click on the delete button that calls the delete method and deletes the records from the Grid View From all the examples above we see how to reduce the code required to perform these tasks.Most of the examples floating around that show how to do inline- or Form Template-based editing with Telerik's Rad Grid use the Sql Data Source's Insert Command, Update Command, and Delete Command properties along with a bunch of declarative parameters to manipulate the data.Since I don't believe that ASPX pages are an appropriate place to be sprinkling SQL around, I put together this brief example of how to use a Form Template for editing, but keep the data-tweaking in code-behind where it belongs. In the Rad Grid tag, declare a handler for the On Update Command event. Declare an Edit Form Settings section and make sure you set its Edit Form Type to "Template" or you will get the baked in auto-form.In the next article I will explain how to Implement a 2-tier architecture which makes my code much simpler and reusable, I hope this article is useful for all students and beginners.

Tags: , ,