Articles in this section

How to show the image in GroupDropArea for particular column in WPF DataGrid (SfDataGrid)?

You can add the image in GroupDropAreaItem for particular column in WPF DataGrid (SfDataGrid). In that you can bind the GridColumn.HeaderTemplate to the content template of ContentPresenter.

<Style TargetType="{x:Type Syncfusion:GroupDropAreaItem}">
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="{x:Type Syncfusion:GroupDropAreaItem}">
                <Border x:Name="PART_GroupDropAreaItemBorder"
                Background="{TemplateBinding Background}"
                BorderBrush="{TemplateBinding BorderBrush}"
                BorderThickness="{TemplateBinding BorderThickness}"
                Opacity="{TemplateBinding Opacity}"
                SnapsToDevicePixels="True">
                    
. . . . 
. . . .
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <Grid Grid.Column="0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <ContentPresenter Margin="5" Grid.Column="0"
                                        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                        VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                        Content="{Binding Path=GroupName,
                                                        RelativeSource={RelativeSource TemplatedParent},
                                                        Mode=TwoWay}" 
                                        ContentTemplate="{Binding Path=GridColumn.HeaderTemplate,
                                RelativeSource={RelativeSource TemplatedParent},
                                                        Mode=TwoWay}"/>                                   
 
. . . .
. . . .
                </Border>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>

 

Image to show the GroupDropAreaItem contains Image

View sample in GitHub.

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied