Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
275
Field value cell with multiple lines of text
posted

Hello

I have a XamDataCards object that takes a custom Person object as its DataSource.

Person object has a number of public fields. One of them is FullAddress which is of type string and the value contains new line delimiters "\r\n".

Can I somehow format the field value cell of the DataCard to display the FullAddress text in multiple lines?

For example, if the value is

"Home House \r\n 31 Low Street \r\n London \r\n SW5 7NL"

to display it as

"Home House

31 Low Street

London

SW5 7NL"

in the cell.

Many thanks.

Kostas.

Parents
  • 8421
    Verified Answer
    posted

    Hello Kostas,

    By default the CellValuePresenter will display the text on multiple lines. The issue is that the size of the CellValuePresenter for the field is not large enough to display all of the text. The easiest way to resolve this is to set the Height for the field:

     

                <igDP:XamDataCards.FieldLayouts>
                    <igDP:FieldLayout>
                        <igDP:Field Name="ID"/>
                        <igDP:Field Name="Name"/>
                        <igDP:Field Name="FullAddress" Height="50"/>
                    </igDP:FieldLayout>
                </igDP:XamDataCards.FieldLayouts>

     

    In theory you could also bind the Height property to the value of the field and use a converter to determine how large it should be based off of the amount of new line characters are in the text along with the font size of the text. This could prevent the fields being too large though all cards would have the same height for the FullAddress field.

     

Reply Children
No Data