Datagrid for local data 
Author Message
 Datagrid for local data

Is it possible to fill in the datagrid with local variables. I would like to
fill it in with array of strings?

Alex



Sun, 04 Jul 2004 02:25:37 GMT  
 Datagrid for local data


Quote:
> Is it possible to fill in the datagrid with local variables. I would like to
> fill it in with array of strings?

According to the docs, the "DataSource" property can be:

- A DataTable
- A DataView
- A DataSet
- A DataViewManager
- A single dimension array
- Any component that implements the IListSource interface
- Any component that implements the IList interface

--
Patrick Steele
Microsoft .NET MVP



Sun, 04 Jul 2004 03:44:21 GMT  
 Datagrid for local data
Hi Patrick,

I read that, but I am missing the example:(

Regards, Alex


Quote:


> > Is it possible to fill in the datagrid with local variables. I would
like to
> > fill it in with array of strings?

> According to the docs, the "DataSource" property can be:

> - A DataTable
> - A DataView
> - A DataSet
> - A DataViewManager
> - A single dimension array
> - Any component that implements the IListSource interface
> - Any component that implements the IList interface

> --
> Patrick Steele
> Microsoft .NET MVP



Sun, 04 Jul 2004 04:42:36 GMT  
 Datagrid for local data
Alex,

  During runtime, you can say:

    myGrid.SetDataBinding(myStringArray, null);

The strings should now appear in your data grid as a single column.

Erik Brown


Quote:
> Hi Patrick,

> I read that, but I am missing the example:(

> Regards, Alex





> > > Is it possible to fill in the datagrid with local variables. I would
> like to
> > > fill it in with array of strings?

> > According to the docs, the "DataSource" property can be:

> > - A DataTable
> > - A DataView
> > - A DataSet
> > - A DataViewManager
> > - A single dimension array
> > - Any component that implements the IListSource interface
> > - Any component that implements the IList interface

> > --
> > Patrick Steele
> > Microsoft .NET MVP



Sun, 04 Jul 2004 06:10:57 GMT  
 Datagrid for local data
The issue is that if one does the following:

  myGrid.SetDataBinding(new String[]{"one", "two", "three"});

You will get a list that displays "3", "3", "5" as the data grid will
display the first public property of the object in the array, in this case
length. It is therefore important to consider how you use this functionality
and perhaps introduce a wrapper class that has a single property that
exports the value you wish.

Note, this is well described in the WROX press C# book.

----------


"Never give in--never, never, never, never, in nothing great or
 Small, large or petty, never give in except to convictions of
 honour and good sense." - Winston Churchill


Quote:

> Alex,

> During runtime, you can say:

>   myGrid.SetDataBinding(myStringArray, null);

> The strings should now appear in your data grid as a single column.

> Erik Brown



>> Hi Patrick,

>> I read that, but I am missing the example:(

>> Regards, Alex





>>>> Is it possible to fill in the datagrid with local variables. I would
>> like to
>>>> fill it in with array of strings?

>>> According to the docs, the "DataSource" property can be:

>>> - A DataTable
>>> - A DataView
>>> - A DataSet
>>> - A DataViewManager
>>> - A single dimension array
>>> - Any component that implements the IListSource interface
>>> - Any component that implements the IList interface

>>> --
>>> Patrick Steele
>>> Microsoft .NET MVP



Tue, 06 Jul 2004 03:43:50 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Local data >32k error

2. Error : local data >32k bitmap.h line 27 }

3. Directly sending data to local printer.

4. Thread-local data in a static .LIB (without MFC)

5. aligning local data on to 16 byte Boundary

6. Thread-local data in a static .LIB (without MFC)

7. retrieving dataview or datagrid filtered data

8. Showing related data from different tables in the same datagrid

9. Formatting data in a DataGrid

10. Datagrid w/o data?

11. Retrieve Data From Datagrid

12. Storing data from a datagrid into an XML file

 

 
Powered by phpBB® Forum Software