I have a WPF application that uses data templates to bind and format a ListView control. The data templates are also supposed to control the text alignment in the cells of the ListView. Here is an example of one template:
The problem I am having is that the "center" is not applied, the text is left justified in the textblock, however the binding works correctly and the correct data is displayed.
This template is used like this:
<ListView x:Name="lstCues" Background="{x:Null}" Foreground="#FFD3F506" ItemsSource="{Binding Mode=OneWay}"> <ListView.View> <GridView> <GridViewColumn Width="50" Header="Cue ID" CellTemplate="{StaticResource CellID}" /> <GridViewColumn Width="200" Header="Name" CellTemplate="{StaticResource CellName}"/> <GridViewColumn Width="400" Header="Filename" CellTemplate="{StaticResource CellFilename}"/> </GridView> </ListView.View></ListView>Anyone have ideas why this is not working? I am pretty sure this is how I have done this in the past.Thanks,Sid.
Open in new window