Geeks With Blogs
Jeremy Ramos Resource blog (C# | ASP.NET | VB | WPF | WSDL | SQL | SharePoint | InfoPath | SSRS | SSIS)

I have been researching about this the whole morning and never found a straight forward answer. I will not be giving codes on this post BUT I will however encourage you not to do this for 3 good reasons:

  1. Ask yourself again if you really need to do this, and why. Gridviews are only graphical representations of set(s) of data from databases and/or datasets. So, ofcourse, if you wanted to add a row to your gridview, add it up on the table on your database and use the DataBind() method to bind the grid again from its data source.
  2. Let the database do its job. It is easier to handle data transactions on the database rather than in codes.
  3. For example, you've managed to get your code working to insert into a gridview dynamically, what next? Would you want to overwrite the database table with you gridview? I am not exactly sure if you can do this but this is a very bad programming practice.
Posted on Monday, November 3, 2008 12:16 PM | Back to top

Comments on this post: Adding rows dynamically to a gridview

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © Jeremy Ramos | Powered by: