Search code examples
windows-phone-8datepickerwindows-phone-toolkit

Show only month and year in DatePicker WP8


    <toolkit:DatePicker Value="2/28/2010" />

I need show only month and year in my date picker (WP8). I've tried to do this in such way, but it was not working:

    <toolkit:DatePicker Value="{Binding DateValue}" ValueStringFormat="{}{0:MM-yyyy}" />

I need it for DatePickerPage too.


Solution

  • You cannot implement this by adding xaml string format. For implement such functionality you need to edit the toolkit code. For that you can download the open source code from CodePlex. After downloading the project find the Date Picker class and edit the relevant methods to remove the date. recompile the source in release mode and you can use that new dll.