views:

31

answers:

1

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.

+1  A: 

Hello,

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.

Brian
^^ won't be able to use the footer approach as it doesn't goes with my reqt.
Dienekes
what is your requirement? If within the grid you want to see the added item, you have to go with the first approach: add a dummy item to add a new item to the list. Or, consider the ListView control, which has insertion features in-built.
Brian
^^ Yep, I went with adding an empty/dummy item to the list and rebinding the grid to it.. thanks for the help..
Dienekes