show database stored (date)values as sellected in calender controle.
I have some stored date开发者_StackOverflow values in DB. i want to show those dates as sellected in my calender control.i just need the code (C# 2008 windows application) pls help me.
XAML Code :
<DatePicker Grid.Column="0" Grid.Row="1" HorizontalAlignment="Left" Margin="100,50,0,10" Name="dateText" VerticalAlignment="Top" Width="120" >
<DatePicker.SelectedDate>
<Binding Path="Date" />
</DatePicker.SelectedDate>
</DatePicker>
NOTE : You will have to bind the collection in the code-behind like following :
this.DataContext = data; // data will be the collection or list you are using.
精彩评论