O'Reilly logo

ASP.NET Developer's JumpStart by Ken Getz, Paul D. Sheriff

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required