4

This doesn't seem to always be the case, but often the datepicker month label is truncated when expanded to select dates : screenshot (while the datepicker is inserted in a grid with "*" space). Has anyone encountered this as well ? If so how can we solve this issue ?

EDIT 13/07/2011 : sample xaml

<UserControl x:Class="Module.View.ConfigView"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
         xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
         mc:Ignorable="d" 
         d:DesignHeight="300" d:DesignWidth="300">
<Grid>

    <Expander Header="Options"
              ExpandDirection="Down"
              IsExpanded="True">

        <Grid>

            <StackPanel Orientation="Horizontal" Margin="5,5,5,5">
                <Label Width="50" HorizontalAlignment="Left">From :</Label>
                <DatePicker HorizontalAlignment="Left"/>
            </StackPanel>

        </Grid>


    </Expander>

</Grid>

EDIT 21/07/2011 : I tested following your comments, indeed the issue comes from the theme I applied. Since I did not change the DatePicker itself, I guess I need to find the dependancy and understand the building blocks of the DatePicker.

EDIT 5 minutes later : this actually comes from the default width of my Button template. If I increase it, it is fine. So I guess the bounty comes to Mamta Dalal, many thanks.

fabien
  • 2,041
  • 1
  • 16
  • 19
  • 1
    pls paste the mockup XAML for this – Bek Raupov Jul 12 '11 at 09:22
  • I Cannot reproduce the problem with the supplied XAML. – MarcelDevG Jul 18 '11 at 10:50
  • the JQuery UI Datepicker is always another alternative: http://jqueryui.com/demos/datepicker/ – William Niu Jul 18 '11 at 21:42
  • 1
    @William : don't think jquery will do for wpf. @MarcelDevG : I will provide a complete code sample. – fabien Jul 19 '11 at 08:07
  • @fabien, sorry, i thought it is for a web application :p – William Niu Jul 19 '11 at 08:17
  • Have you set any options on the DatePicker other than what is shown in the above xaml? Are you using any styles? – Mamta D Jul 19 '11 at 09:09
  • indeed I have a theme defined, but nothing on the datepicker itself. That's a good direction which I will investigate. – fabien Jul 19 '11 at 11:19
  • Is there a way to apply a style only to buttons and not to buttons within controls? I have a lot of buttons on my form, but only one datepicker which is getting screwed up by the button style. I don't like the idea of specifying the style explicitly to each one just so it doesn't bleed over. – Patrick Jan 08 '13 at 14:14

1 Answers1

2

Fabien,

I don't think there is any mistake in the code but u could have tried by increasing the size of the container in the template which holds the month portion and hope that works...

Philemon philip Kunjumon
  • 1,417
  • 1
  • 15
  • 34