Hide next month dates.

9 posts, 0 answers
  1. Saira
    Saira avatar
    24 posts
    Member since:
    Feb 2013

    Posted 23 Jul 2013 Link to this post

    Hi

    I dont want the radcalendar to display dates from months other than the one selected on the header. Suppose I select july means, after july 31 the calendar display august dates. Please help
    Saira
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 23 Jul 2013 Link to this post

    Hi Saira,

    Try setting the ShowOtherMonthsDays property of the RadCalendar to false in order to achieve your requirement.

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Saira
    Saira avatar
    24 posts
    Member since:
    Feb 2013

    Posted 23 Jul 2013 Link to this post

    Seems simple. I wasnt aware of such a property. I have another question, I am dynamically creating a radcalendar and as usual its displaying the current month view. So how can I display another month view with a certain date selected?
  5. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 23 Jul 2013 Link to this post

    Hi Saira,

    Please have a look into the following C# code I tried which works fine at my end.

    C#:
    RadCalendar calendar1 = new RadCalendar();
    //setting the selected date
    calendar1.SelectedDate = System.DateTime.Parse("2013/08/24");
    //changing the calendar view to the selected date
    calendar1.FocusedDate = calendar1.SelectedDate;
    //Adding the control to the current form.
    this.form1.Controls.Add(calendar1);

    Thanks,
    Princy.
  6. Saira
    Saira avatar
    24 posts
    Member since:
    Feb 2013

    Posted 26 Jul 2013 Link to this post

    Hello princy

    Thanks a lot. I have another question. There are two radmonthyearpicker and after I want to calculate the difference between selected date. Please help.
  7. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 26 Jul 2013 Link to this post

    Hi Saira,

    Please have a look into the following code I tried which works fine at my end.

    ASPX:
    <telerik:RadMonthYearPicker ID="RadMonthYearPicker1" runat="server">
    </telerik:RadMonthYearPicker>
    <telerik:RadMonthYearPicker ID="RadMonthYearPicker2" runat="server">
    </telerik:RadMonthYearPicker>
    <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />

    C#:
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (RadMonthYearPicker1.SelectedDate > RadMonthYearPicker2.SelectedDate)
        {
            int monthdifference=   ((RadMonthYearPicker1.SelectedDate.Value.Year - RadMonthYearPicker2.SelectedDate.Value.Year) * 12) + RadMonthYearPicker1.SelectedDate.Value.Month - RadMonthYearPicker2.SelectedDate.Value.Month;
        }
    }

    Thanks,
    Princy.
  8. Alok
    Alok avatar
    2 posts
    Member since:
    Sep 2014

    Posted 24 Sep 2014 Link to this post

    Hi,

    I have set the ShowOtherMonthsDays = fasle which is correct but dynamically i am adding css for my selected date.
    So in this case this is not working css still there.

    See the code

    DateTime dConfirmdate = Convert.ToDateTime(RDPSiteSurveyDate.SelectedDate);
            DateTime dProposaldate = Convert.ToDateTime(RDPInstallationProposed.SelectedDate);
            if (e.Day.Date.ToString("dd/MM/yyyy 00:00:00").Equals(dConfirmdate.ToString("dd/MM/yyyy 00:00:00")))
            {
                    e.Cell.CssClass = "ConfirmedDates";
                    e.Cell.ToolTip = "Confirmed Survey \n" + dConfirmdate.ToString("dd/MM/yyyy");
            }
            if (e.Day.Date.ToString("dd/MM/yyyy 00:00:00").Equals(dProposaldate.ToString("dd/MM/yyyy 00:00:00")))
            {
                e.Cell.CssClass = "ProposedDates";
                e.Cell.ToolTip = "Proposed Dates \n" + dProposaldate.ToString("dd/MM/yyyy");
            }
  9. Angel Petrov
    Admin
    Angel Petrov avatar
    1006 posts

    Posted 29 Sep 2014 Link to this post

    Hi,

    I am not sure about the exact scenario but you should be able to resolve the problem by applying the below provided CSS.
    .rcOtherMonth {
                background:none !important;
            }

    If the issue persists please share with us the entire page contents so we could further research the matter.

    Regards,
    Angel Petrov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  10. Alok
    Alok avatar
    2 posts
    Member since:
    Sep 2014

    Posted 29 Sep 2014 in reply to Angel Petrov Link to this post

    No Problem!!

    I solved my problem using -

     if (e.Cell.CssClass.Equals(""))
                {
                    e.Cell.CssClass = "ConfirmedDates";
                    e.Cell.ToolTip = "Confirmed Survey \n" + dConfirmdate.ToString("dd/MM/yyyy");
                }
    Well i will try your solution, hope this will work.

    Thanks...... 








Back to Top
UI for ASP.NET Ajax is Ready for VS 2017