Today I worked on implementing a GridView that would have the following features:
- Inline add/edit/delete
- Delete confirmation
- Data access through object data source
Out of the box GridView let's you edit/delete items inline, but not add them.
There are a couple of pretty good solutions already available. Some notable
articles are:
For my solution I decided to stick 'Add New' button above GridView.
If user clicks on the button and gridview is empty -- a single
empty row is created and set into 'Edit Mode'. If grid view has items
when user clicks on 'Add New' -- new empty row is created right under the
header and set to 'Edit Mode'.
There is no use of Footer and if the list is big enough it is a lot easier to
see new items on top of the list instead of the bottom.
Anyways, without further delay, here is the GridView in action:
Click here to see the sample
I provided the code for VS 2005 web application.
Let me know if you have any questions.
Download code here
|