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

[Solved] Can I get the current date in a custom style data template

2 Answers 81 Views
Calendar for XAML
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Tomer
Top achievements
Rank 1
Tomer asked on 04 Jun 2013, 05:53 AM
So a data template in the calendar looks like:

<local:CustomStyleSelector.SelectedEvent>
              <DataTemplate>
                  <Grid>
                      <TextBlock Foreground="#FF3399FF" FontSize="15" HorizontalAlignment="Right" FontFamily="Segoe UI Symbol" Text="" />
                      <TextBlock Text="{Binding Label}"
                                 Foreground="#FF3399FF" FontSize="13.333" VerticalAlignment="Bottom" Margin="6,0,0,4"  />
                  </Grid>
              </DataTemplate>
          </local:CustomStyleSelector.SelectedEvent>

Is there a way to get more than the "Label". For example, can one know the exact day of the cell?

2 Answers, 1 is accepted

Sort by
0
Ivaylo Gergov
Telerik team
answered on 05 Jun 2013, 07:45 AM
Hi Tomer,

Thank you for your interest.

The DataContext for the cell template is of type CalendarCellModel, so you can get the exact date through the Date property.

I hope this helps. Let me know if I can assist you in some other way.

Regards,
Ivaylo Gergov
Telerik
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
Zeeshan
Top achievements
Rank 1
answered on 29 Jul 2013, 06:43 PM
Thanks for sharing a great template.. For more information HeRe
Tags
Calendar for XAML
Asked by
Tomer
Top achievements
Rank 1
Answers by
Ivaylo Gergov
Telerik team
Zeeshan
Top achievements
Rank 1
Share this question
or