Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: WPF C#4.0 DataGrid , +
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
<dg:DataGridTemplateColumn Header="DOB" MinWidth="100" >
 
<pre>
                    &lt;dg:DataGridTemplateColumn.HeaderStyle&gt;
 
                        &lt;Style TargetType="{x:Type dg:DataGridColumnHeader}"&gt;
                            &lt;Setter Property="Background" Value="Green"/&gt;
                            &lt;Setter Property="Foreground" Value="Black"/&gt;
                            &lt;Setter Property="FontSize" Value="20"/&gt;
                            &lt;Setter Property="HorizontalContentAlignment" Value="Center" /&gt;
                            &lt;Setter Property="Width" Value="Auto"/&gt;
                        &lt;/Style&gt;
                    &lt;/dg:DataGridTemplateColumn.HeaderStyle&gt;
 
                    &lt;dg:DataGridTemplateColumn.CellEditingTemplate&gt;
                        &lt;DataTemplate&gt;                                                                  
 
                            &lt;dg:DatePicker SelectedDate="{Binding DOB}" SelectedDateFormat="Short"  
                                            CalendarStyle="DynamicResource CalenderControlTemplate"/&gt;                                
                        &lt;/DataTemplate&gt;
 
                    &lt;/dg:DataGridTemplateColumn.CellEditingTemplate&gt;
 
                    &lt;dg:DataGridTemplateColumn.CellTemplate&gt;
                        &lt;DataTemplate&gt;
                            &lt;TextBlock Text="{Binding DOB, StringFormat=d}" 
                                       Foreground="Crimson" HorizontalAlignment="Center" /&gt;
                        &lt;/DataTemplate&gt;
                    &lt;/dg:DataGridTemplateColumn.CellTemplate&gt;
 
                &lt;/dg:DataGridTemplateColumn&gt;

Posted 14-Jan-12 4:59am
Comments
Nestor Arturo at 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)

  Print Answers RSS
0 OriginalGriff 490
1 Sergey Alexandrovich Kryukov 335
2 ProgramFOX 265
3 Maciej Los 245
4 Andreas Gieriet 200
0 OriginalGriff 465
1 Sergey Alexandrovich Kryukov 275
2 ProgramFOX 265
3 Maciej Los 245
4 Andreas Gieriet 200


Advertise | Privacy | Mobile
Web01 | 2.8.150331.1 | Last Updated 14 Jan 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100