Is possible margin/padding in GridViewImageColumn?

2 posts, 0 answers
  1. Mikel
    Mikel avatar
    21 posts
    Member since:
    Feb 2014

    Posted 29 Feb Link to this post

    Hi

     

    Just a question. Is possible to set margin directly to image of GridViewImageColumn? Something like:

    <telerik:GridViewImageColumn
        ImageMargin="4"/>

     

    If there isn't any property for do that, Should I modify datatemplate for apply it?

     

    Thank you! Regards!

  2. Stefan X1
    Admin
    Stefan X1 avatar
    523 posts

    Posted 02 Mar Link to this post

    Hi Mikel,

    Such visual modification can be achieved by defining a Style targeting GridViewCell and setting the Padding property. This style can be applied by the CellStyle property of the column as follows.
    <Style TargetType="telerik:GridViewCell"
           x:Key="imageCellStyle">
        <Setter Property="Padding" Value="5"/>
    </Style>

    <telerik:GridViewImageColumn DataMemberBinding="{Binding Image}"
                                 CellStyle="{StaticResource imageCellStyle}"/>

    In addition, you can check out the Styling Cells topic

    Hope this helps.

    Best Regards,
    Stefan X1
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top