[ACCEPTED]-Setting Column Background in WPF ListView/Gridview-styles
Accepted answer
Set the HorizontalContentAlignment
of the ItemContainerStyle
:
<ListView ItemsSource="{Binding}">
<ListView.ItemContainerStyle>
<Style TargetType="ListViewItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
</Style>
</ListView.ItemContainerStyle>
</ListView>
Result:
0
Digging up an old thread, but I found a 5 dodgy fix for this
<Grid Background="{Binding backGround}" Margin="-6,0,-6,0">
<TextBlock Margin="6,0,6,0" Text="{Binding myText}" TextAlignment="Right" />
</Grid>
Moves the margins so the 4 background color fills the entire cell, but 3 then moves them back so the text is still 2 in the right spot. Works for now until 1 it's fixed properly.
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.