Looping through the container object in a datagrid?

O

Oleg

HI, all...

I have a problem that I've been trying to solve for a couple of days
now. First off - I have a datagrid which receives data from a
dynamically composed dataset (i.e. every time there is a different
number of COLUMNS in a dataset with different names, but are in
sequencial order - column_name1, column_name2... and so on)

What I want to do is format the layout of the datagrid using container
object or any other formatting tool, but since my columns are
dynamically named I can't say Container.DataItem("column_name"),
because I don't know the column_name before hand... now if I could
know how many COLUMNS there are in a container and loop through them
creating the name inside a loop (i.e. adding an integer to the end of
column_name is how my names are set up) ... and I can't find a way to
see how many columns there are in the container.... is there a way to
get that, or is there any other way to do it?

Please help...

Sincerely,
Oleg
 

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,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top