G
Greg Ellis
I'm trying to find a way to loop through the Calendar Control and add
business days next to each day in the calendar after the SelectedDate.
Example: if a user selects May 2nd 2005, I want the calendar to display
|3-1|, |4-2|, |5-3|...etc.
I created a loop to display this. However, the loop is running first before
rendering it.
It looks like |3-1-2-3-4-5|, |4-1-2-3-4-5|, |5-1-2-3-4-5|...etc.
I currently have the loop set from 1 to 5, but once I get this working it
will be set from 1 to 90.
private void calWorkDays_DayRender(object sender,
System.Web.UI.WebControls.DayRenderEventArgs e)
{
for(int x = 1; x < 6; x++)
{
e.Cell.Controls.Add(new LiteralControl(" - " +
x.ToString()));
}
}
I have code that bypasses weekends and holidays. that all works fine. It's
this loop that's killing me. I have tried everything I can think of to get
this to work. I was thinking that a "foreach" might do the trick, but I
can't get the syntax right with it.
any help would greatly be appreciated,
thanks.
business days next to each day in the calendar after the SelectedDate.
Example: if a user selects May 2nd 2005, I want the calendar to display
|3-1|, |4-2|, |5-3|...etc.
I created a loop to display this. However, the loop is running first before
rendering it.
It looks like |3-1-2-3-4-5|, |4-1-2-3-4-5|, |5-1-2-3-4-5|...etc.
I currently have the loop set from 1 to 5, but once I get this working it
will be set from 1 to 90.
private void calWorkDays_DayRender(object sender,
System.Web.UI.WebControls.DayRenderEventArgs e)
{
for(int x = 1; x < 6; x++)
{
e.Cell.Controls.Add(new LiteralControl(" - " +
x.ToString()));
}
}
I have code that bypasses weekends and holidays. that all works fine. It's
this loop that's killing me. I have tried everything I can think of to get
this to work. I was thinking that a "foreach" might do the trick, but I
can't get the syntax right with it.
any help would greatly be appreciated,
thanks.