ok i read up on enumeration and don't really understand
what you mean by
enumerating sun - sat. also, i don't want to loop through
my datacollection
98 times, which is how many cells there are. what I am doing now is
creating the table giving each cell a unique ID (date +
hour). if you want
to see the table, here it is:
http://www.futureshirts.com/calendar/weekView.aspx?SelectedDate=6/18/2003 12:
00:00%20AM
wouldn't it be a better idea to just loop through the data
once after the
table is created, find the cell that matches the event by
date + hour, then
add the event to that cell? the only problem i'm having
is referencing the
cell. I could do a FindControl, but I don't really know
how to use the
results, since it is a control. I always get the "Object
reference not set
to an instance of an object". what do you think?
thanks - trevor
Jay Pondy said:
Create the row and then enumerate Sun - Sat adding a cell
for each and
at the same time query the data source to see if you need to add a
literal control for that days cell contents.
Trevor said:
The table is dynamic, and I just want 7 individual table
cells, and create a
new instance every time I have a new row. how would I do
an enumerator in
this case??
its like this:
TableRow row = new TableRow(); etc..
Why not just using an enumerator and refer to the tables
cell collection?
Once you have a reference to the tablecell object you can
add to it's
controls collection.
Hi,
I need to refer to my objects dynamically. I have a 7
table cells
(sunCell,
monCell, tueCell....). I am looping through some data,
checking its
date
and adding it to the correct cell. I want to be able to
do something
like:
string day;
foreach ...
{
day = getShortDay(someDateTime);
[day + "Cell"].Controls.Add(new LiteralControl("put
some content in
this
cell.."));
}
Is there anyway to do this?
thank you - Trevor