views:

52

answers:

3

I'm using a gridview to display and access a sql database and using databinding. I'm also using autogenerate columns as one gridview has multiple sources and toggles between them. What would be the best way to allow the user to insert a new row?

Would a listview be better?

A: 

What about changing the DataGridView.EditMode property to something other than EditProgramatically?

John at CashCommons
A: 
  • FormView on the page, DefaultMode = Insert, and provide an Insert Template.
  • Add buttons / visibility toggles / datahookup etc. as needed.
Tobiasopdenbrouw
Formview? Where is the DefaultMode option?
Shawn
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.formview.defaultmode.aspx
Tobiasopdenbrouw
A: 

Easiest way to to add a detailsview, set it to the datasource of the gridview and done.

Shawn