We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Selected Date not being highlighted

I have following code for showing the control:

<syncfusion:SfCalendar x:Name="DueDate"
                       HorizontalAlignment="Left"
                       Background="#383842"
                       Width="250"
                       Height="250"
                       SelectionMode="Single"
                       ShowNavigationButton="True"
                       FirstDayofWeek="Monday"
                       PreviousScrollButtonTemplate="{ThemeResource PreviousButtonTemplate}"
                       NextScrollButtonTemplate="{ThemeResource NextButtonTemplate}"
                       HeaderTemplate="{ThemeResource HeaderTemplate}"
                       CellTemplate="{ThemeResource Template}"
                       BorderBrush="#383842"
                       BorderThickness="5"
                       SelectedDateBackground="Red"
                       SelectedDate="{Binding RegistrationDate, Mode=TwoWay}"
                       DisplayDate="{Binding RegistrationDate, Mode=TwoWay}">
</syncfusion:SfCalendar>

As can be seen that I am binding RegistrationDate to both SelectedDate and DisplayDate properties of the control.

RegistrationDate == DateTime.Now;

But when I am setting my RegistrationDate property from my code-behind it is not being highlighted on SfCalendar control.
How can I resolve this?

7 Replies

MS Mariappan S Syncfusion Team November 16, 2015 08:05 AM UTC

Hi Ibrahim,

Thank you for contacting Syncfusion support.

We have prepared sample by using your code snippets and we have checked the reported issue in this sample. But we are unable to reproduce the reported issue in this sample.

Please download the sample from the below link.

Sample link: SfCalendarSample


Please have a look at the sample and if the issue still exists, could you please try reproducing it in the above sample or send reproducible sample and the reproducing steps so that we could sort out the cause of the issue and provide you the solution?

Regards,
Mariappan S.


II Ibrahim Islam replied to Mariappan S November 16, 2015 02:09 PM UTC

Hi Ibrahim,

Thank you for contacting Syncfusion support.

We have prepared sample by using your code snippets and we have checked the reported issue in this sample. But we are unable to reproduce the reported issue in this sample.

Please download the sample from the below link.

Sample link: SfCalendarSample


Please have a look at the sample and if the issue still exists, could you please try reproducing it in the above sample or send reproducible sample and the reproducing steps so that we could sort out the cause of the issue and provide you the solution?

Regards,
Mariappan S.

Thanks for your reply.
I found out that its because I changed the CellTemplate to one of my custom template.
I have made the change in your solution and attached it back here.
Please see it and suggest what I can do.
Thanks.

Attachment: SfCalendarSample_4ff37a44.zip


MS Mariappan S Syncfusion Team November 17, 2015 10:39 AM UTC

Hi Ibrahim,

We have checked your last updated sample and we are able to reproduce the reported issue. In this sample, you have defined the custom “Background” color of the Grid panel in CellTemplate and this color overrides the SelectedBackgroundColor. So, the highlighted color gets hidden under the CellTemplate.  We have modified the sample and we have removed that “Background” color in that sample.

Please download the modified sample from the below link.

Sample link: SfCalendarSample

Regards,
Mariappan S.



II Ibrahim Islam replied to Mariappan S November 17, 2015 11:31 AM UTC

Hi Ibrahim,

We have checked your last updated sample and we are able to reproduce the reported issue. In this sample, you have defined the custom “Background” color of the Grid panel in CellTemplate and this color overrides the SelectedBackgroundColor. So, the highlighted color gets hidden under the CellTemplate.  We have modified the sample and we have removed that “Background” color in that sample.

Please download the modified sample from the below link.

Sample link: SfCalendarSample

Regards,
Mariappan S.


Thanks for your reply.
But If I do not set the Background property to my custom color then I cannot get the look I want for the control.
Is there a way that I can set the Background property and also have the SelectedDateBackground property applied too?


MS Mariappan S Syncfusion Team November 18, 2015 06:16 AM UTC

Hi Ibrahim,

We were able to reproduce the “CalendarView Background doesn’t apply while set Background color to CalendarView” issue and have logged defect report regarding this. The fix for this issue will be included in our Service pack2 volume 3 2015 release which is scheduled by end of November 2015.

Regards,
Mariappan S.


II Ibrahim Islam replied to Mariappan S November 18, 2015 07:07 AM UTC

Hi Ibrahim,

We were able to reproduce the “CalendarView Background doesn’t apply while set Background color to CalendarView” issue and have logged defect report regarding this. The fix for this issue will be included in our Service pack2 volume 3 2015 release which is scheduled by end of November 2015.

Regards,
Mariappan S.

Thanks a lot.
Looking forward to the fix.


MS Mariappan S Syncfusion Team November 19, 2015 04:02 AM UTC

Hi Ibrahim,

Thank you for your update.

We will include the fix for this issue in our Vol 3 2015 Service Pack2 which is scheduled by end of November 2015.

Please let us know if you need further assistance.

Regards,
Mariappan S.

Loader.
Up arrow icon