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

Date Picker arrow

9 Answers 388 Views
DatePicker 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.
Lars
Top achievements
Rank 1
Lars asked on 25 Oct 2012, 11:51 AM
Hello,

is there any possibility to remove the arrow button on the right-handed side of the date- and time-pickers for Windows 8 Xaml? Or at least to change its background image?

Thanks for helping me :)

9 Answers, 1 is accepted

Sort by
0
Accepted
Ivaylo Gergov
Telerik team
answered on 25 Oct 2012, 02:24 PM
Hello, Lars

Thank you for using RadControls for Windows 8!

In order to remove or edit this arrow you can override the control template. The target type is DateTimePickerButton and it is in the Telerik.UI.Xaml.Controls.Input.DateTimePickers namespace. I have prepared you a sample project where I have removed the arrow. Please find the attached file. The template of this part of the control is the TextBlock in the bottom of the Template with x:Name="DropDownGlyph". You can remove the text or style it according to your preferences.     

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

Greetings,
Ivaylo Gergov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Lars
Top achievements
Rank 1
answered on 25 Oct 2012, 02:44 PM
This solution works great, thanks a lot!
0
Simon
Top achievements
Rank 1
answered on 10 Oct 2013, 07:44 PM
Is there anyway this can be done in c# codebehind?  Based on current state I need to make the datepicker readonly and hide the arrow, and then show again when its not readonly.

Thanks
Simon
0
Simon
Top achievements
Rank 1
answered on 10 Oct 2013, 07:45 PM
Is there anyway this can be done in c# codebehind?  Based on current state I need to make the datepicker readonly and hide the arrow, and then show again when its not readonly.

Thanks
Simon
0
Rosy Topchiyska
Telerik team
answered on 11 Oct 2013, 01:44 PM
Hi Simon,

I have prepared two sample projects that demonstrate how you can control the text of the DropDownGlyph depending on the IsEnabled property of the picker:
  • Via bindings to a view model
  • Via binding directly to the IsEnabled property of the picker using a value converter
Is there another reason to set the style in code behind? If yes, we will think of a way to do it.

I hope this was useful and I look forward to your reply.


Regards,
Rositsa Topchiyska
Telerik
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
Simon
Top achievements
Rank 1
answered on 15 Oct 2013, 07:56 PM
Yes, unfortunately I do need to do this in code behind.  The reasoning is that our form fields are all built out dynamically from configuration that is read at runtime so the datepicker controls are generated on the fly at runtime.

Can you help me figure out how I can hide this arrow in code behind?
0
Ivaylo Gergov
Telerik team
answered on 16 Oct 2013, 10:25 AM
Hello Simon,

In this case I can suggest that you create a UserControl that is represented by a RadDatePicker and use the given example that hides/shows the arrow depending on the RadDatePicker.IsEnabled value. For your convenience, I have attached a project that matches this scenario.

Let me know if this works for you.

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
Simon
Top achievements
Rank 1
answered on 16 Oct 2013, 01:39 PM
Unfortunately this solution won't work for my situation very well as we already have a custom control in which all form controls are rendered from on the fly.  Also, I don't like the idea of implementing a customized telerik control since this may make upgrades more difficult.  Is there anyway using codebehind or styles to just hide the arrow or changes its color?

Thanks again,
Simon
0
Rosy Topchiyska
Telerik team
answered on 17 Oct 2013, 04:12 PM
Hi Simon,

I have attached a sample project that demonstrates how to do that. In the Assets folder I have added a ResourceDictionary where are defined all resources you need for the style. The BuildAction of the file is set to Content. Then in the LoadXaml method in the MainPage class the file is read, parsed  and the content is added to the Resources of the picker.

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

Regards,
Rositsa Topchiyska
Telerik
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
Tags
DatePicker for XAML
Asked by
Lars
Top achievements
Rank 1
Answers by
Ivaylo Gergov
Telerik team
Lars
Top achievements
Rank 1
Simon
Top achievements
Rank 1
Rosy Topchiyska
Telerik team
Share this question
or