composite table made of column objects

M

max

Dear Group,

I'm just learning Windows Forms and C# (just in time for it to be
replaced by MS What's Next) and have a question concerning displaying
columnar data in a single datagridview.

My data is stored as a collection of column objects , each of which
contains an array of values as well as datatype info. I want to
assemble an ordered group of these columns into a data table and use a
datagridview to manipulate it. Basically, this is the same thing as
a list of records but my data is stored in column-order rather than
row order. I would like to dynamically be able to add and delete
columns from the group.

How can I collect these columns into a virtual table of records and
have the data binding mechanism provide the connection between the
grid & the virtual table? Utilmately, I'd like this table definition
to be dynamic. Also, copying is not an option -- I've got way too
much data.

Thanks for your guidance.

Max
 
N

Nicholas Paldino [.NET/C# MVP]

In this case, you will want to use the virtual mode of the DataGridView.
You can do this by setting the VirtualMode property of the instance to true.
You will then have to respond to the events that the DataGridView fires to
populate the view. For more information on how to do that, check out the
section of the MSDN documentation titled "Walkthrough: Implementing Virtual
Mode in the Windows Forms DataGridView Control", located at:

http://msdn2.microsoft.com/en-us/library/15a31akc.aspx
 
M

max

Thanks, Nicholas.

I've already discovered that excellent article and tried it. What I
was hoping for is some type of object that would pull together my
various columns and bind them into to an Ilist collection so that
when I add a "record" to the list, it would add the individual fields
to their respective columns.

Max
 

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