Is there a way to hide other month?

5 posts, 1 answers
  1. Hee
    Hee avatar
    25 posts
    Member since:
    Sep 2011

    Posted 09 Oct 2011 Link to this post

    I modified css for to hide other month. (refer to my css code) And that's work it.
    But, it display again during show advanced edit form. (refer to 'othermonth.jpg')
    So, what should I do for to hide other month during show advanced edit form?

    Here is my css code.
    .RadScheduler_Default .rsMonthView .rsOtherMonth
    {
        background-color: #fff !important;
        background-image: none !important;
    }
     
    .RadScheduler_Default .rsOtherMonth div
    {
        display: none;
    }

    Thanks
    Hee.
  2. Plamen
    Admin
    Plamen avatar
    3049 posts

    Posted 12 Oct 2011 Link to this post

    Hi Hee,

    You can use WebService binding or just hide the appointments like in the code bellow:
    protected void RadScheduler1_TimeSlotCreated(object sender, TimeSlotCreatedEventArgs e)
       {
           if (RadScheduler1.SelectedView==SchedulerViewType.MonthView)
           {
               if (RadScheduler1.SelectedDate.Month!=e.TimeSlot.Start.Month)
               {
                   foreach (Appointment ap in e.TimeSlot.Appointments)
                   {
                       ap.CssClass = "visible";
                   }
               }
           }    
       }

    .visible
          {
              visibility:hidden !important;
              }

    In the other cases the modal form overrides the css styles.

    Hope this will be helpful.

    Best wishes,
    Plamen Zdravkov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  3. Hee
    Hee avatar
    25 posts
    Member since:
    Sep 2011

    Posted 12 Oct 2011 Link to this post

    Thanks Plamen.
    But I've already tried it. And it does not work too.
    I want to know that hide other month during showing advanced insert(edit) form.
    Your code work only when just the view mode.

    Actually I succeeded hide other month using javascript(code below).
    But I don't want to use javascript. I want to use css or code-behind. So if you know that the other ways, please help me.

    function pageLoad() {
        var scheduler = $find("<%= RadSchedulerTest.ClientID %>");
        var selectedMonth;
        var month;
     
        //Remove other month.
        if (scheduler.get_selectedView() == Telerik.Web.UI.SchedulerViewType.MonthView) {
            selectedMonth = scheduler.get_selectedDate().format("MM");
            if (selectedMonth.substring(0, 1) == "0") {
                selectedMonth = selectedMonth.substring(1);
            }
     
            $telerik.$(".rsDateHeader").each(function (index) {
                month = $(this).attr("title").split("/");
                if (selectedMonth != month[0]) {
                    this.innerText = "";
                }
            });
        }
    }

    Thanks
    Hee
  4. Answer
    Plamen
    Admin
    Plamen avatar
    3049 posts

    Posted 13 Oct 2011 Link to this post

    Hello Hee,

    If you use WebService binding your css will be working after you open the advanced form  as well . Here you can see a video about it where I used your css:
    http://screencast.com/t/PiIiZeXWxB3

    In the all other cases the advanced modal form will override the styles of the time slot. Only the appointments' css will be preserved as in the code that I sent you before. So if you want to do some changes you will have to use javascript.

    Hope this will help you.

    Regards,
    Plamen Zdravkov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  5. Hee
    Hee avatar
    25 posts
    Member since:
    Sep 2011

    Posted 13 Oct 2011 Link to this post

    Plamen,
    Thanks for your reply.

    I don't use Webservice binding but I doing data binding manually.
    So maybe it's due to.
    Anyway, thank you again.
    I will use javascript.

    Hee
Back to Top