views:

48

answers:

1

Is it possible to populate asp.net GridView with data and operate on those data without dataBinding, as it is possible with Winforms DataGridView?

+1  A: 

You can set the data source to a datatable that you can build up in code with whatever you like.

Here's a link showing how to build a datatable in code...

http://www.aspnettutorials.com/tutorials/controls/data-table-csharp.aspx

You would then add rows to the table and set it to the data source for your gridview.

You can also set a gridview's data source with a list:

http://www.aspnettutorials.com/tutorials/advanced/ilist-interface-aspnet2-vb.aspx

klabranche
Isn't this databinding? this.GridView1.DataSource = ((DataTable)Session["myDatatable"]).DefaultView;this.GridView1.DataBind();
JMSA
This is also databinding. Me.GridView1.DataSource = userinfosMe.GridView1.DataBind()
JMSA
All unbound means to me is that the grid is not operating against a DB for me (insert, update, delete,etc).. I control that not the grid. In the above scenario's I control the grid which is the same in the winforms world to me....
klabranche