Asp onrowupdating inserts new row kimberly raye dead end dating novels

by  |  03-Oct-2016 08:48

In this article, I am going to take a simple database table that has following fields: Auto ID - Int, Auto Increment, Primary Key Page Name - Varchar(50) Page Description - Varchar(500) Active - Bit(1) In this article, I am not going to explain the workings of Sql objects but focusing on the events and methods of the Grid View that will help us in updating and deleting the records.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.In this article, I am going to explain how to manipulate data using Grid View control.

asp onrowupdating inserts new row-12

This will make sure that Bind Data() method will not fire when you are going to edit, update or delete the record.

In Bind Data() method, I am getting the data from database using Sql objects and specifying the Data Source property of the Grid View to the Pages Data table of the Data Set.

For Page Name and Page Description field I want them to appear in the Text Box in edit view, so I have specified text property of Text Box as the field value in Edit Item Template and for Active field, I want it to appear as the Drop Down List so I have specified the Selected Value property as the value of the Active field.

You may notice that the last column of the Grid View is a Delete column that let user delete the record from database, so I have placed Delete link button inside the tag and have specified on Click property as Java Script confirm return value, so that when user clicks on it he/she sees a confirmation box whether he/she really wants to delete the record.

When Edit link of the Grid View will be clicked then On Row Editing event will fire that will call Edit Record method.

Community Discussion