Asp.Net Calender, how to display 5 lines if there are only 5 lines in one month?

Discussion in 'ASP .Net' started by Jack, Oct 11, 2005.

  1. Jack

    Jack Guest

    To whom may concern:


    In Asp.Net Calender control, how to display 5 lines if there are only 5
    lines in one month? Now there are 6 lines even that I don't show the
    data in other months.

    Thanks in advance!


    Jack
    2005-10-11
     
    Jack, Oct 11, 2005
    #1
    1. Advertising

  2. All months which begin on a Friday or a Saturday
    need to display 6 lines, because there's 4 complete
    weeks and 2 partial weeks in them.

    To display a calendar so that the months which *can* display in
    5 lines (the months which start on Sun, Mon, Tue, Wed or Thu)
    do display in 5 lines, set the ForeColor and BackColor properties
    for the "OtherMonthDay Style" to white.

    <asp:Calendar ID="Calendar1" runat="server" OtherMonthDayStyle-BackColor="White"
    OtherMonthDayStyle-ForeColor="White"></asp:Calendar>

    If you have set the Calendar's BackColor to any other color
    but white, set the "OtherMonthDay Style" to whatever BackColor
    you set the Calendar's BackColor to.



    Juan T. Llibre, ASP.NET MVP
    ASP.NET FAQ : http://asp.net.do/faq/
    Foros de ASP.NET en Español : http://asp.net.do/foros/
    ======================================
    "Jack" <> wrote in message
    news:...

    > In Asp.Net Calender control, how to display 5 lines if there are only 5
    > lines in one month? Now there are 6 lines even that I don't show the
    > data in other months.
     
    Juan T. Llibre, Oct 11, 2005
    #2
    1. Advertising

  3. Jack

    Jack Guest

    Hi, Juan:

    It works if I set ShowGridLines = False, but not if ShowGridLines =
    True.
     
    Jack, Oct 12, 2005
    #3
  4. Hmmm...that's odd but, if that what it takes, fine.

    See the calendar at :

    http://asp.net.do/calendario/Calendario.aspx

    It's created with only :

    <asp:Calendar ID="Calendar1" runat="server" OtherMonthDayStyle-BackColor="White"
    OtherMonthDayStyle-ForeColor="White"></asp:Calendar>

    I didn't set ShowGridLines = False ... but it works.

    In any case, I'm glad it's working, Jack.



    Juan T. Llibre, ASP.NET MVP
    ASP.NET FAQ : http://asp.net.do/faq/
    Foros de ASP.NET en Español : http://asp.net.do/foros/
    ======================================
    "Jack" <> wrote in message
    news:...
    > Hi, Juan:
    >
    > It works if I set ShowGridLines = False,
    > but not if ShowGridLines = True.
     
    Juan T. Llibre, Oct 12, 2005
    #4
  5. Jack

    Jack Guest

    Yes, I know your solution, but my customer need GridLine. :(
     
    Jack, Oct 12, 2005
    #5
  6. I guess you'll have to write a Calendar of your own, then.

    Why would your customer require gridlines ?

    Talk your customer out of that.
    It's not like gridlines are very functional, anyway.



    Juan T. Llibre, ASP.NET MVP
    ASP.NET FAQ : http://asp.net.do/faq/
    Foros de ASP.NET en Español : http://asp.net.do/foros/
    ======================================
    "Jack" <> wrote in message
    news:...
    > Yes, I know your solution, but my customer need GridLine. :(
     
    Juan T. Llibre, Oct 12, 2005
    #6
  7. Jack

    Jack Guest

    :), in fact, I think Calender with GridLine is more beautiful than the
    one without GridLine.
     
    Jack, Oct 12, 2005
    #7
  8. But not if it displays unneeded lines, right ?

    ;-)



    Juan T. Llibre, ASP.NET MVP
    ASP.NET FAQ : http://asp.net.do/faq/
    Foros de ASP.NET en Español : http://asp.net.do/foros/
    ======================================
    "Jack" <> wrote in message
    news:...
    > :), in fact, I think Calender with GridLine is more beautiful than the
    > one without GridLine.
    >
     
    Juan T. Llibre, Oct 12, 2005
    #8
  9. Jack

    Jack Guest

    Yes, that's true, but that's why I post here.
    If you can tell me how to custom Calendar, that's better. ;)
     
    Jack, Oct 12, 2005
    #9
  10. Jack

    Jack Guest

    Which method or event in Calendar shall I override?
     
    Jack, Oct 12, 2005
    #10
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Michal Maciejczak
    Replies:
    1
    Views:
    1,990
    Matthias Kaeppler
    Apr 23, 2005
  2. Bill
    Replies:
    10
    Views:
    741
    Fulvio
    Apr 13, 2006
  3. =?Utf-8?B?YW1qYWQ=?=

    calender month control with asp.net

    =?Utf-8?B?YW1qYWQ=?=, Aug 4, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    401
    =?Utf-8?B?YW1qYWQ=?=
    Aug 4, 2006
  4. Replies:
    1
    Views:
    459
    Steve W. Jackson
    Dec 22, 2006
  5. Mason Kessinger
    Replies:
    16
    Views:
    283
    David Brady
    Jan 20, 2006
Loading...

Share This Page