[2005] Data Grid View problem
I can't get my datagridview control on my form (named dgv) to actually display a dataset that I know is not empty. I know I'm forgetting something stupid but I skimmed through the list of methods and properties of the datagridview control and I didn't see anything too familiar. Here's my current code:
Code:
Dim ds As New DataSet()
ds.ReadXml(txtPathA.Text)
MessageBox.Show(ds.Tables(0).Rows(0).Item(0))
dgv.DataSource = ds
And the messagebox does in fact show what's in the first table's first row in the first column but dgv is still totally blank and has a rowcount of 0 and everything after it all executed. I know with like list boxes and stuff if you bind it to a datasource, you have to set the display member or something but I don't remember what I'm forgetting for the dgv!
EDIT: well I just realized it can display one single table at a time but I couldda sworn I saw a DGV at some point display multiple tables at a time so what's up with that?
Re: [2005] Data Grid View problem
If you bind a DataSet then you need to set the DataMember to specify the DataTable to display.
The DataGridView does not support relationship navigation at all. The DataGrid does but will still only display data from one table at a time. You'd need to create your own customised grid, which would be a lot of work, or use a third party control if you want more.