Cell content spacing

2 posts, 0 answers
  1. Danijel
    Danijel avatar
    2 posts
    Member since:
    Jul 2013

    Posted 25 Jan 2017 Link to this post


    how can I specificy content margin in respect to cell borders (regardless of column type)?  i.e. padding from Cell's POV.

  2. Lance | Manager - Technical Support
    Lance | Manager - Technical Support avatar
    1112 posts

    Posted 25 Jan 2017 Link to this post

    Hi Danijel,

    You can edit the CellContentStyle of the column, then either change the Padding or Margin. As an example, here's a DataGridTextColumn's style:

    <grid:DataGridTextColumn  >
            <Style TargetType="TextBlock">
                <Setter Property="Padding" Value="2,2,2,2"/>
                <Setter Property="Margin" Value="2,2,2,2" />

    If you also want to apply such a padding when the cell is being edited, you can update the CellEditorStyle as well.

        <Style TargetType="TextBox">
            <Setter Property="Padding" Value="2,2,2,2" />
            <Setter Property="Margin" Value="2,2,2,2" />

    To see all of the Column types and what their target types are, go to this page in the documentation.

    Lance | Tech Support Engineer, Sr.
    Telerik by Progress
    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
Back to Top