Click here to Skip to main content
15,881,803 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
I have a DataGrid which have on DateTime column. but i am unable to change the style of the calender.please help me somebody. the code is here
XAML
<dg:DataGridTemplateColumn Header="DOB" MinWidth="100" >
                        
                        <dg:DataGridTemplateColumn.HeaderStyle>

                            <Style TargetType="{x:Type dg:DataGridColumnHeader}">
                                <Setter Property="Background" Value="Green"/>
                                <Setter Property="Foreground" Value="Black"/>
                                <Setter Property="FontSize" Value="20"/>
                                <Setter Property="HorizontalContentAlignment" Value="Center" />
                                <Setter Property="Width" Value="Auto"/>
                            </Style>
                        </dg:DataGridTemplateColumn.HeaderStyle>
                                 
                        
                        
                        <dg:DataGridTemplateColumn.CellEditingTemplate>
                            <DataTemplate>                                                                  
                                
                                <dg:DatePicker SelectedDate="{Binding DOB}" SelectedDateFormat="Short"  
                                                CalendarStyle="DynamicResource CalenderControlTemplate"/>                                
                            </DataTemplate>
                           
                        </dg:DataGridTemplateColumn.CellEditingTemplate>
                        
                        <dg:DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding DOB, StringFormat=d}" 
                                           Foreground="Crimson" HorizontalAlignment="Center" />
                            </DataTemplate>
                        </dg:DataGridTemplateColumn.CellTemplate>
                        
                    </dg:DataGridTemplateColumn>
Posted
Comments
Nestor Arturo 16-Jan-12 9:21am    
Do you mean that 'CalendarStyle="DynamicResource CalenderControlTemplate"' is not working?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900