datepicker问题 - 日历大小太大了

时间:2015-09-11 11:34:49

标签: wpf datepicker

以下xaml日期选择器(下拉列表)日历及其日期宽度太大。如何减少压光机的宽度和压光天数。 请帮我解决这个问题

<Grid Grid.Column="0">
<Grid.ColumnDefinitions >
                                <ColumnDefinition Width="134"/>
    <ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions >
    <RowDefinition />
    <RowDefinition />
    <RowDefinition />
    <RowDefinition />
</Grid.RowDefinitions>
<TextBlock Text="Client Name" Grid.Row="0" Grid.Column="0"/>
<TextBox Text="{Binding DataContext.client_name, ElementName=Parant}" 
         MaxLength="50"
         Padding="2"
         Height="25"
         Grid.Row="0" Grid.Column="1"/>

<TextBlock Text="Building Location" Grid.Row="1" Grid.Column="0"/>
<TextBox MaxLength="255" 
         Text="{Binding DataContext.location, ElementName=Parant}"  
         Grid.Row="1" 
         AcceptsReturn="True" 
         TextWrapping="Wrap" 
         Height="40"
         Grid.Column="1" />

<TextBlock Text="Date" Grid.Row="2" Grid.Column="0"/>
<!--<TextBox MaxLength="255" 
         Text="{Binding DataContext.survey_date, ElementName=Parant}"  
        Grid.Row="2" Grid.Column="1"/>-->
<DatePicker Name="DtpFromDate"  
                SelectedDate="{Binding DataContext.SurvayDatetime , ElementName=Parant}" 
                Margin="5"
                Width="230"
                HorizontalAlignment="Left" 
                Height="25"  Grid.Row="2" Grid.Column="1"  />


<!--<TextBlock Text="Edit Lock:" Grid.Row="3" Grid.Column="0"/>
<ComboBox ItemsSource= "{Binding DataContext.elockList, ElementName=Parant}"  
          SelectedValue="{Binding DataContext.elock, ElementName=Parant}"  
          Grid.Row="3" Grid.Column="1" />-->

<TextBlock Text="Turn Around Time" Grid.Row="3" Grid.Column="0"/>
<ComboBox ItemsSource="{Binding DataContext.turnaroundList, ElementName=Parant}"
           SelectedValue ="{Binding DataContext.turnaround, ElementName=Parant}"  
          Height ="25"
          Grid.Row="3" 
          Grid.Column="1"/>

请查看日历图片,并提供解决此问题的解决方案。 我的日期选择器显示为:datePicker

1 个答案:

答案 0 :(得分:-1)

添加日历自定义样式后问题解决了