Re: Calendar SelectedDates quirk? [wpf:61002 [wpf:63103

Jul 21, 2009 at 11:37 PM
Awesome Eric! This was the missing piece! After stretching the TextBlocks across the ListView column, the TextAlignment property on the individual column took effect. I've been banging my head on the wall for some time now on this issue. It wasn't obvious that the TextBlock was not taking up the whole column width as it would be for TextBox controls. This really makes sense to me now. This is the final code:

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

Hanoverian (AKA John)

-----Original Message-----
From: ericf <>
To: [email removed]
Sent: Tue, Jul 21, 2009 3:14 pm
Subject: Re: Re: Calendar SelectedDates quirk? [wpf:61002 [wpf:63103]

From: ericf
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
<font size="2" color="#a31515"><font size="2" color="#a31515">
</font></font><font size="2" color="#a31515">
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 22, 2009 at 12:45 AM

Glad I could help :) A simple/personal tip: when I'm having layout-related issues, I like to put a red border around the elements that aren't cooperating. It lets me see how much space they're actually taking up.