Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I see an array of dates for bolded dates.

 

Is there any such way to instead make certain dates Red and others Green?

 

I need to show users which dates aren't allowed to be chosen (red) and which they have chosen (green).

 

I could do it with bold dates being illegal and a listbox of chosen dates, but thats a waste of space.

 

Any clue on this?

Posted

There is a DayRender event that fires when each day is printed in the calendar. If you know the dates, store them in an array, and in the DayRender event, check for the eventArgs.Day.Date.

What I did was to define a Style and then apply it to the days I wanted.

 

For example

 

Dim vacStyle As New Style()

vacStyle.ForeColor = System.Drawing.Color.Red

 

eventArgs.Cell.ApplyStyle(vacStyle)

 

That shoud do it.

 

Oh Yeah, the event args are DayRenderEventArgs)

Hope this helps.

 

 

-lp

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...