How to insert row into datagrid on winform without dataconnection
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.
Re: How to insert row into datagrid on winform without dataconnection
I think all you need is declare a datatable --> config it then set it to datagrid.datasource.
have fun!
Quote:
System.Data.DataTable myDataTable = new System.Data.DataTable();
myDataTable.TableName = "FromUser";
myDataTable.Columns.Add("Col1");
myDataTable.Columns.Add("Col2");
this.dataGrid1.DataSource = myDataTable;
Re: How to insert row into datagrid on winform without dataconnection
Thanks a lot. I will try it out.