小编Dav*_*rey的帖子

Assigning Style resources to a DataGrid

Apologies for the maybe hazy nature of this question, but I am fairly new to WPF and am consequently struggling with the issue of resources.

My problem is that I have a DataGrid that I wish to assign a style to that describes properties such as the FontSize and Background/Foreground colours (when the mouse hovers over the rows). I can do this successfully as follows:

<Window x:Class="WpfApplication11.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525">

    <Grid>
        <DataGrid Name="DataGrid1" ItemsSource="{Binding Path=Fibers}">
            <DataGrid.RowStyle> …
Run Code Online (Sandbox Code Playgroud)

wpf resources xaml datagrid staticresource

4
推荐指数
1
解决办法
5521
查看次数

标签 统计

datagrid ×1

resources ×1

staticresource ×1

wpf ×1

xaml ×1