Hi,
> What do I use to display text in a tabular format where i can iterate
> through columns and rows.
>
> I have tried to use the datagrid previously but it needs a datasource.
> There
> is also no clear cut solution to add in records to the datagrid.
You could parse your csv file into a DataTable, and then use this as the
datasource. For example:
// Create a DataTable containing our data
DataTable dt = new DataTable("People");
dt.Columns.Add("Name", typeof(String));
dt.Columns.Add("Age", typeof(int));
dt.Rows.Add("Christopher", 25);
dt.Rows.Add("Bob", 31);
dt.Rows.Add("Jane", 30);
// Use it as the datasource for our data grid
dataGrid1.DataSource = dt;
To add new/edit data you can just alter the DataTable and the datagrid will
update automatically.
Hope this helps,
Christopher Fairbairn
WD - 31 Jan 2008 04:00 GMT
Thanks!
That worked perfectly.
How would I implement a search in this...
i tried
dt.Rows.Find(<key>);
but it didn't work b/c I have no primary key.
Is there a way to search the whole contents of the data on the datagrid(or
even just by rows), and then extract a whole row out and split into variables?
Thanks

Signature
WD
> Hi,
>
[quoted text clipped - 25 lines]
> Hope this helps,
> Christopher Fairbairn
Another possible solution is to use the TextDataAdapter from the Smart
Device Framework. It provides a direct DataAdapter to a CSV file, making it
directly bindable.
http://opennetcf.com/library/sdf/html/9ad043db-5fff-ce9f-cf21-4d1d5634f638.htm

Signature
Chris Tacke, eMVP
Join the Embedded Developer Community
http://community.opennetcf.com
> Hi,
>
[quoted text clipped - 8 lines]
>
> Thanks,