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

Turn off highlighted or selected date style

8 Answers 137 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 10 Aug 2016, 01:15 PM

When I click a date on the calendar screen and then return to the calendar the date I just visited shows up on the calendar as having a orange box around it.  How do I turn this off?  I assume it is either the highlighted date or selected date property (http://docs.telerik.com/devtools/wpf/controls/radcalendar/structure) as both of those have the organge box i don't want to appear.

Thank you for your help,
Andrew

8 Answers, 1 is accepted

Sort by
0
Andrew
Top achievements
Rank 1
answered on 12 Aug 2016, 12:16 PM
Would any more information about this question be helpful in answering it?
0
Masha
Telerik team
answered on 15 Aug 2016, 06:40 AM
Hi Andrew,

I guess you want to remove the focused border around calendar button. In order to achieve this you need to modify the control template of CalendarButtonStyle. Inside it look for Focused VisualState and remove the storyboard inside it. Also you need to set RenderFocused="False" of telerikChromes named SelectionChrome.

I demonstrated this approach  in the attached project. Please note the project uses implicit styles and NoXaml binaries.

I hope this helps.

Regards,
Masha
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Andrew
Top achievements
Rank 1
answered on 16 Aug 2016, 03:14 PM

Thanks for helping Masha!

I want to remove the orange box and the filled interior that is also a orange gradient.  In the example demo I ran it is still there? (see attached image)

The orange box that shows up when you hover the mouse over the date is fine and can stay there.

Thanks,

Andrew

0
Accepted
Masha
Telerik team
answered on 17 Aug 2016, 12:52 PM
Hi Andrew,

Simply set RenderHighlighted="False"  of ButtonChome named SelectionChrome inside CalendarButtonStyle. This way the mouse over border will disappear.

I hope this helps.

Regards,
Masha
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Andrew
Top achievements
Rank 1
answered on 17 Aug 2016, 05:57 PM

Hey Masha,

Yes, you are correct - I change the RenderHighlighted to False and the mouse over border disappears.  That lead me right to what I was trying to ask about.  I changed RenderSelected="False" and everything works as I want.

Thanks so much for your help,

Andrew

0
Andrew
Top achievements
Rank 1
answered on 17 Aug 2016, 07:12 PM

One more question. In implementing this solution in my project I realized I use DayButtonStyleSelector class and went to implement your solution in the code file.  I beleive i have the correct render selected property set:

Dim propStyleChrome As DependencyProperty = Telerik.Windows.Controls.Chromes.ButtonChrome.RenderSelectedProperty

Dim TakencustomStyle As New Windows.Style
TakencustomStyle.Setters.Add(New Setter(propStyleChrome, False))

But that alone doesn't remove the selected box, i think i am missing the part of removing the VisualState of focused you have in your example:
 <VisualStateGroup x:Name="FocusStates">
                                        <VisualState x:Name="Unfocused"/>
                                        <VisualState x:Name="Focused">
                                            <!--<Storyboard>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SelectionChrome" Storyboard.TargetProperty="BorderThickness">
                                                    <DiscreteObjectKeyFrame KeyTime="0">
                                                        <DiscreteObjectKeyFrame.Value>
                                                            <Thickness>1</Thickness>
                                                        </DiscreteObjectKeyFrame.Value>
                                                    </DiscreteObjectKeyFrame>
                                                </ObjectAnimationUsingKeyFrames>
                                            </Storyboard>-->
                                        </VisualState>
                                    </VisualStateGroup>

Is there a way to do this from a code behind?  Or what is a solution i could use to make this work when using a DayButtonStyleSelctor class and have the DayButtonStyle set to nothing.

0
Andrew
Top achievements
Rank 1
answered on 17 Aug 2016, 07:21 PM

You can disregard my last question above - I found a solution that works for me.  I added your xaml code as a application resource and then set the template property in DayButtonStyleSelctor class.

Dim propStyleTemplate As DependencyProperty = Telerik.Windows.Controls.Calendar.CalendarButton.TemplateProperty

TakencustomStyle.Setters.Add(New Setter(propStyleTemplate, DirectCast(Application.Current.Resources("calNoSelectStyle"), System.Windows.Controls.ControlTemplate)))

0
Masha
Telerik team
answered on 18 Aug 2016, 05:34 AM
Hi Andrew,

I'm glad you were able to resolve the issue.

If you have any other questions do not hesitate to contact us again.

Regards,
Masha
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
Calendar
Asked by
Andrew
Top achievements
Rank 1
Answers by
Andrew
Top achievements
Rank 1
Masha
Telerik team
Share this question
or