Came across this question while looking for other information on the DetailsView. An alternative approach to that above is to change the commandfield into a template field (from the Edit Fields dialog box for the details view, select the command field entry in the list of selected fields, then click on the 'Convert this field into a template field' link). Then, back in your source view, you will see something like this: Now, there will also be ItemTemplate and EditItemTemplate entries, but you get the idea. Ive changed the default asp:LinkButton controls to ImageButtons, but you could also use normal buttons, whatever fits your UI design. The important part is the CommandName entry on each control - be it insert, Update, Delete, Cancel - it is that command name that causes the appropriate operation to take place. Hope that give you additional help.
The DetailsView control is used to display a single record from a data source in a table, where each field of the record is displayed in a row of the table. It can be used in combination with a control for master-detail scenarios.
After an update, the DetailsView control raises its ItemUpdated event. You can add a CommandField field with the ShowEditButton property set to true. Nov 20, 2011 Hi, I try using DetailsView with SqlDataSource component. I already defined all select-command until delete command. The DetailsView. The ButtonField element displays the value of a data item as a button in the DetailsView control. In the previous article - DetailsView commandfield we have.
Comments are closed.