unable to display public text field of object in ArrayList in a bound DataGrid

G

Gerd B.

I have a very simple public class X, whose fields are all public. I
create an ArrayList that contains a series of instances of X. Then I
bind a DataGrid object's columns to the public fields of class X The
binding fails because "". Now, if I create properties that return the
fields of X, and I bind the DataGrid columns to these properties,
everything works fine.

I would greatly appreciate it if somebody could answer the following
questions:

1. It is possible to bind columns of a datagrid directly to (public)
fields of objects that are stored in an ArrayList? If yes, how?

2. My class X is only a temporary repository of information that I
generate (compute) dynamically, and I have no really good reason to
use an ArrayList either; I just thought this would be a quick
solution. Are there better ways to organize data for display in a
DataGrid?

Thank you in advance for your answer,

Gerd
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top