MonthYear Picker - Show Year Only

6 posts, 0 answers
  1. Antonio
    Antonio avatar
    1 posts
    Member since:
    Sep 2016

    Posted 23 Sep Link to this post

     

    Hi guys,

     

    I'm using 2 MonthYearPickers on a page and need that one of them to show only the year.

     

    How can i do this? Tryed the css solution with #rcMView_month but that changes for both controls.

     

    Thanks,

    Antonio

     

  2. Eyup
    Admin
    Eyup avatar
    3015 posts

    Posted 28 Sep Link to this post

    Hello Antonio,

    You can use the DateFormat and DisplayDateFormat properties to achieve this requirement:
    <telerik:RadMonthYearPicker ID="RadMonthYearPicker1" runat="server" SelectedDate="2016/5/5">
        <DateInput runat="server" DateFormat="yyyy"></DateInput>
    </telerik:RadMonthYearPicker>

    I hope this will prove helpful.

    Regards,
    Eyup
    Telerik by Progress
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Ana
    Ana avatar
    2 posts
    Member since:
    Sep 2016

    Posted 30 Sep in reply to Eyup Link to this post

    Hi,

    I'm facing the same issue. Your suggestion didn't solve it.

    The most I could get was to hide all months except the current one using a css definition and the MonthCellsStyle property:

    <style type="text/css"
      .hide
      {
        display: none !important;
      }
    </style>

     

    <MonthCellsStyle CssClass="hide" />

     

    Do you know how can I get rid of this current month at the MonthYear picker?

     

    Thank you.

  5. Eyup
    Admin
    Eyup avatar
    3015 posts

    Posted 05 Oct Link to this post

    Hi Ana,

    Could you send us sample screenshots or video demonstrating the exact desired appearance? Thus, we will be able to figure out your specific requirement and suggest a more accurate solution.

    Regards,
    Eyup
    Telerik by Progress
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  6. Ana
    Ana avatar
    2 posts
    Member since:
    Sep 2016

    Posted 06 Oct in reply to Eyup Link to this post

    Hi,

    Of course. I'm attaching two images. Both belong to the same web application page.

    The first one is the MonthYear picker that behaves as expected, because the requirement is to be able to choose a month and an year.

    The second one is the MonthYear picker that don't behaves as expected, because as I explained at my post, I want to show only years, but it is displaying the current month also.

    Hope this helps you understand my problem. Thanks.

    Ana

  7. Eyup
    Admin
    Eyup avatar
    3015 posts

    Posted 11 Oct Link to this post

    Hi Ana,

    You can achieve this requirement using the following approach:
    <telerik:RadMonthYearPicker ID="RadMonthYearPicker1" runat="server" MonthCellsStyle-CssClass="monthCellClass">
    </telerik:RadMonthYearPicker>
    CSS:
    <style>
        .monthCellClass {
            display: none;
        }
     
        .rcSelected {
            display: none;
        }
     
            .rcSelected ~ .rcSelected {
                display: table-cell;
            }
    </style>

    That should do the trick.

    Regards,
    Eyup
    Telerik by Progress
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017