Gridview rowupdating e keys mate dating de

See the code implementation for Row Updating event. We have now covered both Design Time and Run Time binding of Controls, particulary for Dropdown control inside a C1Template Field.Download the attached sample for complete implementation.In this event, we have to add the Selected Value of C1Combo Box in the new Values collection of the eventargs.The new Values collection of the eventargs is then used to add parameters in the Update Parameter collection of Update Command for Access Data Source to which C1Grid View is bound.To get the Primary key, I have used Data Keys property of the Grid View with the index of the row, being edited and stored into a integer variable after parsing.Now I have declared a Grid View Row variable named row and stored the current row being edited into it.So I have to specify how I want them to appear in the normal view and edit view.That’s why I have placed different templates like Item Template (for normal view) and Edit Item Template (for edit view).

In this method, I am specifying the Edit Index property of the Grid View to the New Edit Index of the Grid View and then calling Bind Data() method again to bind the data.

We will bind C1Combo Box in each row using the Row Data Bound event of C1Grid View.

Selected Value property is set to make the C1Combo Box show the value for that particular row from datasource.

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.