Editing Data on the Grid

It's useful to be able to navigate to a new page to edit a full row, but what if you would rather edit data right in the grid? The DataGrid control makes this possible, and, if you're happy with the default layout, extremely easy. By setting a few properties, you can allow users to edit data right in the grid. By writing a little code, you can save the data back out to the original data source.

To add the Edit button to each row (and the associated Cancel and Update buttons, which only display while you're editing a row), you follow the same sorts of steps you used in order to add the Hyperlink column—the Property Builder makes it simple. To add the Edit button, follow these steps:

1.
Open ProductsEdit.aspx in the page ...

Get ASP.NET Developer's JumpStart now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.