Access today button

6 posts, 0 answers
  1. Anu TM
    Anu TM avatar
    6 posts
    Member since:
    Jul 2013

    Posted 29 Jul 2013 Link to this post

    Hi telerik

    In a radmonthyearpicker, please help me to access the today button to give my own text and styling.

    Thankyou
    Anu
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 29 Jul 2013 Link to this post

    Hi Anu,

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

    C#:
    protected void RadMonthYearPicker1_ViewCellCreated(object sender, MonthYearViewCellCreatedEventArgs e)
    {
        //Checking if the cell is of Button type.
        if (e.Cell.CellType == MonthYearViewCellType.ButtonCell)
        {
            //Controls[0] return the first Button ie Today Button
            Button btnToday = (e.Cell.Controls[0] as Button);
            //Setting the custom text and style
            btnToday.Text = "Custom Text";
            btnToday.Style["color"] = "Green";
        }
    }

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Anu TM
    Anu TM avatar
    6 posts
    Member since:
    Jul 2013

    Posted 30 Jul 2013 Link to this post

    Hi shinu, it worked well. The Silk skin is used for the control but I dont want the greenish background on mouse overing. How can I specify a custom background color?
  5. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 30 Jul 2013 Link to this post

    Hi Anu,

    Try overriding the default CSS as follows.

    CSS:
    <style type="text/css">
        .RadCalendarMonthView_Silk a:hover
        {
            background-color: Red !important;
            background-image: none !important;
        }
    </style>

    Thanks,
    Shinu.
  6. Anu TM
    Anu TM avatar
    6 posts
    Member since:
    Jul 2013

    Posted 30 Jul 2013 Link to this post

    Once again thanks for your prompt reply. Now the back ground style has disappeared on mouse overing. I would like to have a border on same mouse overing for each cells (not for the a:hover). I still cannot figure out the right CSS classes.
  7. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 30 Jul 2013 Link to this post

    Hi Anu,

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

    CSS:
    <style type="text/css">
        table.RadCalendarMonthView td:hover
        {
            border: 1px solid Blue;
        }
    </style>

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