views:

26

answers:

1

I have this GridView that have it's DataSource as a list of previously selected products. For every item on it, I need to Eval it's ID and load a specifc form that the user must fill, then after that i've got to update the GridView.

I have made those specific forms as User Controls, is this the best approach for this scenario?

If yes, how can I dynamically load them, in a way that I can make queries/postbacks then update back my gridview?

A: 

What you want to develop is called Master/Detail view. It is described for example in http://www.asp.net/data-access/tutorials/master-detail-using-a-selectable-master-gridview-with-a-details-detailview-cs .

The only difference that as Detail you need use FormView, where on some initialization event (like DataBound http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.basedataboundcontrol.databound.aspx )you need to dynamically create you control and set its parent to current template of FormView

Dewfy