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

Custom calerdar

3 Answers 58 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
vairam
Top achievements
Rank 1
vairam asked on 20 Dec 2008, 11:16 AM
Hi

I want to display in calendar only the Friday's date Instead of displaying all the dates.That means per month i want to display only Four or Five dates.Because our client will run the  report every friday.And i want to set the default date is current week friday date.How can i do this one.
Thanks
Vairam

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 22 Dec 2008, 11:33 AM
Hi Vairam,

To achieve this functionality, you can either disable or hide the unwanted dates. Please try the following code snippets.

CSS:
protected void RadCalendar1_DayRender(object sender, Telerik.Web.UI.Calendar.DayRenderEventArgs e)  
    {        
        if (e.Day.Date.DayOfWeek != DayOfWeek.Friday)  
        {  
            //to hide rest of the Days  
            e.Cell.Text = " ";  
             
            //to disable rest of the days  
            e.Cell.Enabled = false;  
        }  
    } 

Thanks,
Princy.
0
vairam
Top achievements
Rank 1
answered on 22 Dec 2008, 12:29 PM
Hi Princy
Thanks for your response
I am using radDatePicker in this i could not find this event "DayRender".What i need to do?


Thanks
Vairam
0
Dimo
Telerik team
answered on 22 Dec 2008, 12:42 PM
Hi Vairam,

The DayRender event is in Calendar:

<telerik:RadDatePicker>
    <Calendar OnDayRender="" />
</telerik:RadDatePicker>

Regards,
Dimo
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Calendar
Asked by
vairam
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
vairam
Top achievements
Rank 1
Dimo
Telerik team
Share this question
or