Re: Calendar SelectedDates quirk? [wpf:61002

Jul 21, 2009 at 4:21 PM
Thanks Eric,

I'll give it a try ;-) Seems like WPF is a bit on the bleeding edge right now. On another note, I have been trying to set the text alignment of a single column of a ListView control with very little luck. It just seems so normal that some columns might need a different alignment strategy than others. I've gotten pretty close with the code below, but the TextAlignment="Center" below has no effect. Am I missing something here? Is there a more correct way to accomplish this? I have two columns specified below, which are bound to the MovieList ObservableCollection. Right now I have to set the Margin property on the TextBlock inside the DataTemplate to move the text in the column cells such that they look a bit more "centered".

<ListView Grid.Row="1" Name="lstMovies" Margin="10" Height="Auto" ItemsSource="{Binding ElementName=This, Path=MovieList}"
SelectionChanged="lstMovies_SelectionChanged" MouseDoubleClick="lstMovies_MouseDoubleClick">
<GridViewColumn Header="Title" Width="250" DisplayMemberBinding="{Binding Title}" />
<GridViewColumn Header="Movie ID" Width="100">
<TextBlock Text="{Binding MovieID}" TextAlignment="Center" />


-----Original Message-----
From: ericf <>
To: [email removed]
Sent: Mon, Jul 20, 2009 11:30 pm
Subject: Re: Calendar SelectedDates quirk? [wpf:61002]

From: ericf
Hi Hanoverian -
I was able to reproduce your issue and a bug has been filed in our database. I have devised a temporary work-around for you. It may not be the best or the most appropriate, but it should work for your scenario. I highly suggest that you thoroughly test it as it is not guarenteed at all. With that said, you'll have to modify the source code in SelectedDatesCollection.cs, in the ClearItems() function, add the following line after this._owner.SelectedDate = null : this._owner.HoverStart = null;
Let me know if it works out for you :-)
-Eric, MSFT
To add a post to this discussion, reply to this email (
To start a new discussion for this project, email
You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on
Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at

One-click access to hundreds of free games. Get the Toolbar.
Jul 21, 2009 at 7:14 PM
Edited Jul 21, 2009 at 7:15 PM

Hello Again, Hanoverian -

The quirk you are experiencing is a common one. IanG explains it nicely at

Try adding the following to your ListView:

                <Style TargetType="ListViewItem">
                    <Setter Property="HorizontalContentAlignment" Value="Stretch" />

-Eric, MSFT