Updating with gridview

But the value of the ddl box is not inserted into the record.

I'm pretty sure I need to change my Update Command of the sql Data Source that feeds my Grid View, and/or add code to my dropdown box's but I'm at a loss of how to do that.

Now let’s start with putting the Grid View on page. Data Key Names="Auto ID" Auto Generate Edit Button="True" On Row Editing="Edit Record" On Row Canceling Edit="Cancel Record" On Row Updating="Update Record" Cell Padding="4" Header Style-Horizontal Align="left" On Row Deleting="Delete Record" Row Style-Vertical Align="Top" Fore Color="#333333" Grid Lines="None" In the above code, I have kept Auto Generate Columns as false so that Grid View will not render all the fields of the data source automatically.

I have specified Data Key Names as Auto ID, the primary key of the database table.

My main objective in this article is to keep it simple and cover multiple aspects in one article.

updating with gridview-72updating with gridview-34updating with gridview-35updating with gridview-23

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

For Edit and Update I have added a command field which will act as the 5As discussed above I have placed 3 textboxes and a button in the Footer Row of the ASP.

Net Grid View control in order to add new record to the database.

Then I have several methods attached with following events Get video of hundreds of ASP. On Row Editing - Edit Record On Row Cancel Edit - Cancel Record On Row Updating - Update Record On Row Deleting - Delete Record As I set Auto Generate Columns property to false so I am going to manually write the fields name that I need to appear in the way I want.

So I have to specify how I want them to appear in the normal view and edit view.


Leave a Reply