Dienekes
Dienekes

Reputation: 1548

Inserting new row in gridview using an external Add button and a list as data source

I have a grid with three columns, two of which contain drop-downs, all of them getting filled from a web service result set. Now I want to allow the functionality of adding a new record in the grid by clicking an Add button present outside the gridview.

Whenever the user clicks the Add button, a new record should be created in the grid with value list filled in the drop-downs with the available options.

What is the best possible way to achieve this considering extensibility in mind.

Thanks a lot!

P.S. The data source set for the grid is a list.

Upvotes: 0

Views: 1573

Answers (1)

Brian Mains
Brian Mains

Reputation: 50728

Add a blank item to the list, and rebind with this new list and dummy item. That's typically one way to do it, or store the insert form in the footer of the columns. I've used that approach.

Upvotes: 1

Related Questions