views:

59

answers:

4

All, I am creating a web application and I need to give users the ability to add/edit/delete records in a grid type control. I can't use 3rd party controls so I am restricted to just whats in the box for asp.net (datagrid or gridview) or creating my own. Any thoughts on the best direction to go in. I'd like to keep the complexity level at a dull roar :)

thanks in advance daniel

A: 

the out of the box grid is not too bad. Here are a few links on master detail records in asp.net this should get you started on the CRUD opperations.

http://www.exforsys.com/tutorials/asp.net-2.0/displaying-master-detail-data-on-the-same-page.html http://msdn.microsoft.com/en-us/library/aa581796.aspx

http://www.bing.com/search?q=asp.net+master+detail

Chris Jones
+1  A: 

Gridviews have different item templates that you can use for editing and inserting data. That'd be an easy way to go about it.

As long as you set your datakeyid property to the primary key in the database, you should be able to make template fields based off of whether or not you're editing or inserting data. The command name of the button you use to fire the event will handle the statements required for updating/inserting data.

This is a good site for some examples.

Aaron
+2  A: 

You should definitely use edit and insert templates. All you have to do is give the button/link the command name such as insert/delete/update and you can allow the Grid to do most of all the work.

Check out this link

I think you'll learn to love the gridviews because they are pretty powerful.

Eric