Options for a datagrid datasource

J

jhcorey

I have data in a structure (a CellSet) that I can't directly bind to a
datagrid.
So I have to iterate through it and put it into something that I can
bind.
One option would be to create a DataTable and populate it.

Is there something else that someone would use instead? Efficiency and
flexibility are concerns.

(I'm not very conversant with the GridView but I'm willing to look at
it if it has some real advantages here).

TIA,
Jim
 
B

Bob Barrows [MVP]

I have data in a structure (a CellSet) that I can't directly bind to a
datagrid.
So I have to iterate through it and put it into something that I can
bind.
One option would be to create a DataTable and populate it.

Is there something else that someone would use instead? Efficiency
and flexibility are concerns.

Any collection that implements IEnumerable will do: arraylists,
hashtables, etc.

However, since you have to iterate anyways (AddRange is not available?),
why not manually add the datagriditems instead of binding?
(I'm not very conversant with the GridView but I'm willing to look at
it if it has some real advantages here).
Since it is available, I would use it.
 

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

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top