Question

I included everything below since it's not that much. I wasn't sure if something I put elsewhere was causing my setter to not work properly.

                <ListView x:Name="lvReports"
                             SelectionMode="Single"
                             ItemsSource="{Binding reportsCollection}" Height="432" ScrollViewer.HorizontalScrollBarVisibility="Hidden">
                    <ListView.Resources>
                        <Style x:Key="myHeaderStyle" TargetType="{x:Type GridViewColumnHeader}">
                            <Setter Property="HorizontalContentAlignment" Value="Left"/>
                            <Setter Property="TextElement.FontSize" Value="30pt"/>
                            <Setter Property="Width" Value="800"/>
                        </Style>
                    </ListView.Resources>
                    <ListView.GroupStyle>
                        <GroupStyle>
                            <GroupStyle.HeaderTemplate>
                                <DataTemplate>
                                    <DockPanel>
                                        <DockPanel Height="30" VerticalAlignment="Bottom">
                                            <Image Source="\Images\ProductivityByEmployeesReport.png"/>
                                            <TextBlock FontWeight="Bold" FontSize="18pt" Text="{Binding Path=Name}"/>
                                        </DockPanel>
                                    </DockPanel>
                                </DataTemplate>
                            </GroupStyle.HeaderTemplate>
                        </GroupStyle>
                    </ListView.GroupStyle>
                    <ListView.View>
                        <GridView>
                            <GridViewColumn x:Name="colName" HeaderContainerStyle="{StaticResource myHeaderStyle}" Header="Reports">
                                <GridViewColumn.CellTemplate>
                                    <DataTemplate>
                                        <DockPanel>
                                            <Rectangle Width="18"/>
                                            <CheckBox>
                                                <TextBlock Text="{Binding displayName}"/>
                                            </CheckBox>
                                        </DockPanel>
                                    </DataTemplate>
                                </GridViewColumn.CellTemplate>
                            </GridViewColumn>
                        </GridView>
                    </ListView.View>
                </ListView>

Thanks in advance.

Was it helpful?

Solution

Add this to <ListView.Resources>

<Style TargetType="GridViewColumnHeader" x:Key="ColumnHeaderLarge">
   <Setter Property="FontSize" Value="14"/>
</Style>

To set Fontsize to 14, use the style as:

<GridView ColumnHeaderContainerStyle="{StaticResource ColumnHeaderLarge}">
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top