Home Forums WPF controls Xceed DataGrid for WPF Presenting Icon inside cell

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #22540 |

    I am trying to get a very simple functionality – present icon as cell content using DataTriggers. How can I do that? The code example below works fine for Background property, but not for Content (I tried to define image as a StaticResource and bind it content property):

    <Style TargetType=”{x:Type Custom:DataCell}”>
    <Style.Triggers>
    <MultiDataTrigger>
    <MultiDataTrigger.Conditions>
    <Condition Binding=”{Binding RelativeSource={RelativeSource Self}, Path=ParentColumn.FieldName}”
    Value=”IsAck”/>
    <Condition Binding=”{Binding RelativeSource={RelativeSource Self}, Path=Content}”
    Value=”True”/>

    </MultiDataTrigger.Conditions>
    <Setter Property=”Background” Value=”Blue” />

    </MultiDataTrigger>
    </Style.Triggers>
    </Style>

    Thanks in advance,

    Vladimir

    Imported from legacy forums. Posted by Vladimir (had 1813 views)

    User (Old forums)
    Member
    Post count: 23064

    I managed to have it working with a code using CellContentTemplateSelector. But I still wonder if there is an easier way to show icons in DataGrid cells. Looks like a very basic functionality.

    Is it possible to do it with XAML?

    Imported from legacy forums. Posted by Vladimir (had 2983 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.