Link to home
Start Free TrialLog in
Avatar of xjpmauricio
xjpmauricio

asked on

Windows CE Bind HashTable to DataGrid

In windows ce or pocket pc, how i can i bind an HasTable to a DataGrid?

I've tried this but with no resuts...i keep getting an Argument Exception Error...

try
{
  dataGrid1.DataSource = orderItems;//orderItems is the HashTable
  dataGrid1.Refresh();
}
catch(Exception ex){MessageBox.Show(ex.Message);}


...Please Help!
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

You can't bind a Hashtable to a DataGrid, since Hashtable doesn't implement a supportable interface.  You will have to choose a different structure.

Bob
Avatar of xjpmauricio
xjpmauricio

ASKER

What abou if i try to Bind two Arrays to a DataGrid in two different columns of the same DataGrid?

ArrayList deliverDocBoxArr = new ArrayList();
ArrayList collectDocBoxArr = new ArrayList();

How can i do it?
Nope, no can do.

What is wrong with a DataTable?  It has the structure designed for data-binding.

Bob
ok. But how do i add items to a DataTable with two columns and then how do i Bind them to the datagrid?
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
now how do i bind it to the datagrid?
ok i know how to bind it....can u tell me how do i set the width for each column!?
DataGrid table style, column style, width property

Bob
i got it........tnx a lot for the datatable part!