I'm trying to bind Master_Transaction_List, which is an array of list to a datagridview. Currently, only one column is displayed when the list[] is bound to the datagridview at run-time (and it seems to be a column count for each row, rather than actual data).
dh.Fill_Master_Transaction_List("SELECT * FROM transactions_dumpfile WHERE Tran_Price=8000;");
dataGridView1.DataSource = dh.Master_Transaction_List;
Class dh fills a public list[] named Master_Transaction List with the relevant data from a MySQL table according to this query. I can see the query is running fine, and my list[] array is the correct 2-dimensional set of data I am after; 16 columns, ~1k rows.
However when I set datasource for the datagrid, only one column is displayed; showing not the data from list items for each member of the array, but the column count for each member of (i.e. each list within) the array.
Can the issue be that I am using an 'object' datatype for all objects within each array member? Is the datagridview sensitive to this? Do I need to provide it with a schema for the columns in advance?
Edit: to be clear, this is the definition for Master_Transaction_List within dh:
public List<object>[] Master_Transaction_List;
From MSDN
The DataGridView class supports the standard Windows Forms data-binding model.This means the data source can be of any type that implements one of the following interfaces:
The IList interface, including one-dimensional arrays.
The IListSource interface, such as the DataTable and DataSet classes.
The IBindingList interface, such as the BindingList class.
The IBindingListView interface, such as the BindingSource class.
Try to cast outer array to list and inner lists to array. According to that list of arrays is ok