This is a migrated thread and some comments may be shown as answers.

Access today button

5 Answers 36 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Anu TM
Top achievements
Rank 1
Anu TM asked on 29 Jul 2013, 09:04 AM
Hi telerik

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

Thankyou
Anu

5 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 29 Jul 2013, 09:59 AM
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.
0
Anu TM
Top achievements
Rank 1
answered on 30 Jul 2013, 08:26 AM
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?
0
Shinu
Top achievements
Rank 1
answered on 30 Jul 2013, 09:15 AM
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.
0
Anu TM
Top achievements
Rank 1
answered on 31 Jul 2013, 03:17 AM
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.
0
Shinu
Top achievements
Rank 1
answered on 31 Jul 2013, 04:23 AM
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.
Tags
Calendar
Asked by
Anu TM
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
Anu TM
Top achievements
Rank 1
Share this question
or