Click to See Complete Forum and Search --> : How to insert row into datagrid on winform without dataconnection
bhatttushar
July 20th, 2005, 02:35 AM
Can anybody help me with code snippet that can guide me in inserting row in the datagrid control without any data source in the background(i.e. no data connection). I just want to use this datagrid as a source of collecting rows of data from the users. I want to handle insertion of data in database myself.
DHTheNewbie
July 27th, 2005, 09:27 PM
I think all you need is declare a datatable --> config it then set it to datagrid.datasource.
have fun!
System.Data.DataTable myDataTable = new System.Data.DataTable();
myDataTable.TableName = "FromUser";
myDataTable.Columns.Add("Col1");
myDataTable.Columns.Add("Col2");
this.dataGrid1.DataSource = myDataTable;
bhatttushar
August 2nd, 2005, 01:47 AM
Thanks a lot. I will try it out.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.