I am oupando igxGrid, I want to do a line wrap via button.
the first instance looks like this:
using the button that performs the line wrapping:
Thank you.
Hello Mario,
In order to access css classes on a cell click, you can use bootstrap theming and change the theme applied and set the igx-grid__td-text white space property to normal, which will make the text multiline.
I have prepared a sample where you can see that for further reference:
https://stackblitz.com/edit/igx-grid-change-theme-on-button?file=src/app/grid/grid-conditional-cell-style/grid-conditional-cell-style.component.scss
If you have any further questions, please let me know.
Sincerely,Tihomir TonevAssociate Software DeveloperInfragistics
I need this on a button.
Hello,
It seems the text is in the underlying div in the igx-cell__td. Do you need this on a button, or you need it all the time by default as per the sample I have shared in my reply on your other thread here:
https://es.infragistics.com/community/forums/f/ignite-ui-for-angular/122911/editcell-textarea/540484?focus=true
Sincerely,
Tihomir TonevAssociate Software DeveloperInfragistics
In your code snippet, I see that you do "word-wrap": "break-word"
public changedStyles = { background: "linear-gradient(to right, #b993d6, #8ca6db)", "font-weight": "bold", color: (rowData, coljey, cellValue, rowIndex) => rowIndex % 2 === 0 ? "white" : "gray", animation: "0.75s popin", "word-wrap": "break-word", };
I already tried other options:
white-space: pre-wrap! important; overflow-wrap: break-word;
or
white-space: none;
Any other option?
Thank you for posting on our forums.
You can use the cellStyles property exposed by igxColumnComponent in order to apply styling of the cells on demand. More information can be found on our website here:
https://es.infragistics.com/products/ignite-ui-angular/angular/components/grid/conditional-cell-styling
I have prepared a sample for you to demonstrate how to apply css variables on a button click.
https://stackblitz.com/edit/igx-grid-change-cell-style-button
Should you have any further questions, please let me know.