Tutorial :Add new row to gridview



Question:

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?


Solution:1

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


Solution:2

  • FormView on the page, DefaultMode = Insert, and provide an Insert Template.
  • Add buttons / visibility toggles / datahookup etc. as needed.


Solution:3

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


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »