Discussion:
Rendering a 2-D array within a DataGrid??
(too old to reply)
s***@mypisd.net
2017-12-07 02:19:28 UTC
Permalink
Hi,
I've got a 2-D array of, say, Strings, that I wish to render as a
table.
The DataGrid uses the public properties of Objects within an IList (or
IListSource or IBindingList) to determine the number of columns.
However,
the number of public proprties is determined at compile time, whereas
the
size of the 2-D array is unknown until run-time.
What can I do to get the DataGrid to figure out how to display a 2-D
array?
Thanks in advance.
Peter
Good Guy
2017-12-07 03:23:22 UTC
Permalink
Hi,
I've got a 2-D array of, say, Strings, that I wish to render as a
table.
The DataGrid uses the public properties of Objects within an IList (or
IListSource or IBindingList) to determine the number of columns.
However,
the number of public proprties is determined at compile time, whereas
the
size of the 2-D array is unknown until run-time.
What can I do to get the DataGrid to figure out how to display a 2-D
array?
Thanks in advance.
Peter
How about using a list?

Something like this:

|double[,]d
=newdouble[,]{{1.0,2.0},{11.0,22.0},{111.0,222.0},{1111.0,2222.0},{11111.0,22222.0}};List<double>lst
=d.Cast<double>().ToList() Example copied from stackExchange
<https://stackoverflow.com/questions/5132397/fast-way-to-convert-a-two-dimensional-array-to-a-list-one-dimensional>
|
--
With over 600 million devices now running Windows 10, customer
satisfaction is higher than any previous version of windows.
Good Guy
2017-12-07 03:25:56 UTC
Permalink
Hi,
I've got a 2-D array of, say, Strings, that I wish to render as a
table.
The DataGrid uses the public properties of Objects within an IList (or
IListSource or IBindingList) to determine the number of columns.
However,
the number of public proprties is determined at compile time, whereas
the
size of the 2-D array is unknown until run-time.
What can I do to get the DataGrid to figure out how to display a 2-D
array?
Thanks in advance.
Peter
This one is slightly better explained:

<https://www.codeproject.com/Questions/336952/Two-Dimensional-List>
--
With over 600 million devices now running Windows 10, customer
satisfaction is higher than any previous version of windows.
Continue reading on narkive:
Search results for 'Rendering a 2-D array within a DataGrid??' (Questions and Answers)
5
replies
can i get question answer of asp.net ?
started 2006-10-11 00:02:47 UTC
software
Loading...