This is a migrated thread and some comments may be shown as answers.

Is possible margin/padding in GridViewImageColumn?

1 Answer 43 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Mikel
Top achievements
Rank 1
Mikel asked on 29 Feb 2016, 08:00 AM

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!

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 02 Mar 2016, 09:40 AM
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
Tags
GridView
Asked by
Mikel
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or