CellSpacing in a gridviewtemplate

3 posts, 1 answers
  1. Andre
    Andre avatar
    41 posts
    Member since:
    Feb 2018

    Posted 16 Mar 2018 Link to this post

    hello everyone
    i trying to give all cells a CellSpacing in a gridviewtemplate.
    for a radgridview this can be done with radgridview.TableElement.CellSpacing = 3.

     

    Thanks for your help

    andre

  2. Answer
    Dimitar
    Admin
    Dimitar avatar
    2949 posts

    Posted 16 Mar 2018 Link to this post

    Hi Andre,

    You can use the ViewCellFormatting event to access the table element of the child template (each cell will have its own child table element):
    private void RadGridView1_ViewCellFormatting(object sender, CellFormattingEventArgs e)
    {
        if (e.CellElement is GridDetailViewCellElement)
        {
            var cell = e.CellElement as GridDetailViewCellElement;
            cell.ChildTableElement.RowSpacing = 3;
        }
    }

    I hope this will be useful.

    Regards,
    Dimitar
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Andre
    Andre avatar
    41 posts
    Member since:
    Feb 2018

    Posted 16 Mar 2018 Link to this post

    Hello Team, 
    thanks it working perfect :)
Back to Top