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

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top