Results 1 to 4 of 4

Thread: Calander Control ? - Assigning Styles ?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2002
    Location
    Outer space
    Posts
    97

    Talking Calander Control ? - Assigning Styles ?

    Ok i think im getting a little closer with the calender controls, i've figured out how to select dates and recreate multiple instance of the control

    Now all i need to do is to change the style of some of the selected dates i have, but yet again i've run in to a few problems, it appears you can only set the selected style to apply to the whole calender not just to a specific date.

    If n e one's got n e ideas i'd be most grateful !

    Regards
    J Green

  2. #2
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    there is a property called SelectedDayStyle

    you need to create a tableitemstyle object first

    Dim daystyle As New TableItemStyle()

    there are some properties you can set like Backcolor, bordercolor, even cssclass if you want to specify an css class to do the styling

    then set the selecteddaystyle after you set all your properties

    mycalendar.SelectDayStyle = daystyle


    That should work. Havent tried it but that looks correct from the info in wincv.exe
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Aug 2002
    Location
    Outer space
    Posts
    97

    Talking Cheers

    ill give it a go see if it works !


  4. #4
    Member
    Join Date
    Sep 2001
    Location
    Fishburn
    Posts
    45
    You can also change the behaviour or style of particular cells in the calendar by using the Calendar.DayRender event, i.e.

    Private Sub DayRender(Source As Object, e As DayRenderEventArgs) Handles Calendar.DayRender

    If e.Day.IsWeekend Then
    e.Day.IsSelectable = False
    End If

    End Sub

    This example will disable selection of weekends dates. But you can also use the DayRenderEventArgs object to format the cell if you want to format the cell based on the actual date.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width