DataGrids WITHOUT DataTables, etc

J

John

Hi,

I am building an object based system and have my data in the form of objects
with properties. I dont want to have to load them into DataTables just so I
can use them with a DataGrid. However I cannot see any easy way of
switching which cells are read-only or visible once I have bound a
collection to the DataGrid. I have had a look at TableStyles and
GridColumnStyles, but changes I make dont seem to do anything. Can someone
recommend a good site where I can learn about these finer details, without
needing to use DataTables and such like?

Thanks in advance,

j.
 
J

John

Hi,

I managed to find out that I need to put ArrayList in the
TableStyles.MappingName property of the DataGrid. My problem now is that I
am adding multiple objects to the array list and only the first is shown in
the grid. I havent got a clue why this is- none of the properties seem to
indicate what might be going wrong or what I might have omitted.

Please help!

j.
 
O

Otis Mukinfus

Hi,

I managed to find out that I need to put ArrayList in the
TableStyles.MappingName property of the DataGrid. My problem now is that I
am adding multiple objects to the array list and only the first is shown in
the grid. I havent got a clue why this is- none of the properties seem to
indicate what might be going wrong or what I might have omitted.

Please help!

j.
Good luck with your project,

Otis Mukinfus
http://www.arltex.com
http://www.tomchilders.com
 
O

Otis Mukinfus

Hi,

I managed to find out that I need to put ArrayList in the
TableStyles.MappingName property of the DataGrid. My problem now is that I
am adding multiple objects to the array list and only the first is shown in
the grid. I havent got a clue why this is- none of the properties seem to
indicate what might be going wrong or what I might have omitted.

Please help!

j.

John,

If you are using .NET 1.x you will need to implement IBidingList with your
collections. ArrayList objects do not implement IBindingList, so they will not
behave as you expect with DataGrids. Your objects will also need to implement
IEditable. The help files for .NET 1.x have all the information you need to get
started, but there is a lot of work for you to do along the way.

The same is true of .NET 2.0 but it is not as difficult as with .NET 1.x, since
there are generic classes specifically for this type of databinding. A good
book on Data Binding with .NET 2.0 is "Data Binding with Windows Forms 2.0" by
Brian Noyes. Publisher: Addison Wesley. I believe he may have also written a
book targeting .NET 1.x, but do not know that for a fact.

With either version of .NET you will be doing a lot of coding to get it done.
You may want to reconsider using DataSets and DataAdapters after reading up on
what is required.

Good luck with your project,

Otis Mukinfus
http://www.arltex.com
http://www.tomchilders.com
 

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

Top