Add line break in data to display in Grid

Hi, I'd like to add line breaks in my data for a Grid I'm using. No method I have found works. Here is my data file, and where I'd like line breaks to appear. How do I achieve this? I've tried so many methods I've found on the internet, but no luck yet.

export let dateValidationData: Object[] = [
    {
        Type: 'Mandatory (via REGEX)',
        ValidationCriteria: '.{1,}',
        ErrorMessage: 'You must enter a value'
    },
    {
        Type: 'Format',
        ValidationCriteria: 'The entered date must always fit the format of the configured input mask: dd/mm/yyyy or <br />mm/dd/yyyy or<br />yyyy-mm-dd ',
        ErrorMessage: 'You must enter a valid date in the correct format: [configured input mask]'
    },
    {
        Type: 'Range',
        ValidationCriteria: 'The entered date must fall between configured min/max range',
        ErrorMessage: 'The date you have entered is either too far in the past or too far in the future'
    }
];

1 Reply 1 reply marked as answer

SM Shalini Maragathavel Syncfusion Team August 11, 2020 11:02 AM UTC

Hi Alexander, 
 
Greetings from syncfusion control. 
 
We have analyzed your query and understood that you want add a line break in the datasource to display grid column. To achieve your requirement we suggest you to define the column property disableHtmlEncode as false to that particular column. Refer the below code example  for more information. 
 
App.component.html 
 
<div class="control-section"> 
    <ejs-grid #grid [dataSource]='data'  allowPaging="true" [pageSettings]='pageSettings' > 
        <e-columns> 
            <e-column field='Type' headerText='Type' width='150'></e-column> 
            <e-column field='ValidationCriteria' headerText='ValidationCriteria' [disableHtmlEncode]="false" width='250'></e-column> 
            <e-column field='ErrorMessage' headerText='ErrorMessage' width='100' textAlign='Right'></e-column> 
            
        </e-columns> 
    </ejs-grid> 
 
     
</div> 
 
Please find the  below sample for more information. 



Please get back to us if you need further assistance. 

Regards, 
Shalini M. 
 
 
 



Marked as answer
Loader.
Up arrow icon