Calendar control

M

Mystique

Hello,
I am building a page with the ASP.NET Calendar control. Is there any way
i can change the style (ex: background) of certain days, but not one
day, an interval of days (ex: 3,5,6,7)?

Thanks,
Mystiue
 
E

Eirik Eldorsen

You can do this by implementing DayRender event

protected void calendar1_DayRender(object sender,
System.Web.UI.WebControls.DayRenderEventArgs e)

{

if (DateTime.Now == e.Day.Date)

e.Cell.BackColor = System.Drawing.Color.FromArgb(255, 234, 234);

}
 
M

Mystique

Thanks Eirik,
but how can i change the background of the clicked item plus the next 7
items?
 

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
473,769
Messages
2,569,582
Members
45,062
Latest member
OrderKetozenseACV

Latest Threads

Top