Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

Conditional Icon Binding on DataGrid #66

Open
james-poulose opened this issue Sep 10, 2021 · 0 comments
Open

Conditional Icon Binding on DataGrid #66

james-poulose opened this issue Sep 10, 2021 · 0 comments

Comments

@james-poulose
Copy link

I am trying to conditionally display icons using the below code.

<DataGridTemplateColumn Header="Level">
    <DataGridTemplateColumn.CellTemplate>
        <DataTemplate>
            <fa:FontAwesome Icon="Warning"></fa:FontAwesome>
            <DataTemplate.Triggers>
                <DataTrigger Binding="{Binding Path=IsError}" Value="True">
                    <Setter Property="Icon" Value="Stop" />
                </DataTrigger>
            </DataTemplate.Triggers>
        </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>

I am not even able to compile this due to the error
The member "Icon" is not recognized or is not accessible.

Can someone suggest a way to do this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant