Cell vertical aligment

4 posts, 0 answers
  1. Dima
    Dima avatar
    48 posts
    Member since:
    Feb 2012

    Posted 30 Apr Link to this post

    How to align content in cell vertically?

    cell.VerticalAlignment = Telerik.Windows.Documents.Flow.Model.Styles.VerticalAlignment.Center;

    does not help me. Text is still align at top

    cell = row.Cells.AddTableCell();
    cell.VerticalAlignment = Telerik.Windows.Documents.Flow.Model.Styles.VerticalAlignment.Center;
    cell.PreferredWidth = new TableWidthUnit(TableWidthUnitType.Percent, 15);
    paragraph = cell.Blocks.AddParagraph();
    run = paragraph.Inlines.AddRun();
    run.Text = "Text in cell text in cell text in cell";
  2. Tanya
    Admin
    Tanya avatar
    583 posts

    Posted 03 May Link to this post

    Hi Dima,

    The vertical alignment property is not supported when exporting RadFlowDocument do PDF. If this is your case, you can vote for an implementation as well as track the status of the task using the related public item.

    The property should be properly applied if you are using one of the other supported document formats. In case you are experiencing an issue in such a scenario, please send us more information on how we could reproduce it on our end.

    Regards,
    Tanya
    Telerik by Progress

  3. Dima
    Dima avatar
    48 posts
    Member since:
    Feb 2012

    Posted 03 May in reply to Tanya Link to this post

    Is this only export to PDF issue?

    Being able to align text in cell to center is a pretty basic feature. Might be I misunderstand you.

    Or presented I presented wrong example.

    Attaching DOCx to demonstrate
  4. Tanya
    Admin
    Tanya avatar
    583 posts

    Posted 05 May Link to this post

    Hi Dima,

    Yes, the vertical alignment is not supported only when exporting to PDF. For generating DOCX documents, you shouldn't experience any issues. 

    I am not sure I completely understand your scenario and what is the issue you are observing. The document from the image you shared seems to have the vertical alignment of the cell properly applied. Isn't it?

    I am sending you a sample project showing how you can generate a sample DOCX document with a table containing only a single cell with VerticalAlignment=Center.

    Hope this is useful.

    Regards,
    Tanya
    Telerik by Progress

Back to Top