0
Vincent is right, I thought you were using DataGrid control in Winforms..
You could add rows to Datatable..set Datatable as your Datasource for datagrid...
0
DataGrid uses Items instead of Rows.
If you want to add data to DataGrid then you need to add data to your DataSource instead of your DataGrid since the grid render the data based on your data source.
Check this link for example: https://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.datagrid.items(v=vs.110).aspx
0
Is this Winform?, can you see Rows in intellisense after dgv1?
0
i have done and encountered this error
'System.Array' does not contain a definition for 'Rows' and no extension method 'Rows' accepting a first argument of type 'System.Array' could be found (are you missing a using directive or an assembly reference?)
0
parameters are wrong, try this way:
string[] testrow = new string[] { txtname.text,txtAge.Text,txtGender.text };
dgv1.Rows.Add(testrow);