How to add child rows in datagrid c#.net windows forms?
+2
A:
I'm not sure if this is what you're asking, but if you want to append rows you're easiest way is to append them to whatever DataSource you're using before you DataBind()
If this wasn't what you're after, please provide more detail.
Nick Craver
2008-09-19 14:18:12
A:
Usually you bind the datagrid to a dataset. Could you please clarify what you are looking for so that we can get into more detail?
Geoffrey Chetwood
2008-09-19 14:18:28
A:
DataTable myDataTable = new DataTable();
DataGridView myGridView = new DataGridView();
myGridView.DataSource = myDataTable;
DataRow row = myDataTable.Rows.Add(1, 2, 3, 4, 5); //This adds the new row
NotDan
2008-09-19 14:30:32
A:
If you are looking for a nested table, you'll have to go with a third-party control. The DataGridView doesn't support it.
Austin Salonen
2008-09-19 14:37:00
It's not pretty, but you can nest: you create a templateField column in your datagridview, edit the template and put a gridview inside it.
theo
2008-09-19 14:41:04