ReactFix
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • React
  • React Native
  • Programming
  • Object Oriented Programming

Sunday, November 6, 2022

[FIXED] How to show full string on a DataGridPro cell instead of ellipsizing the string?

 November 06, 2022     datagrid, javascript, material-ui, reactjs   

Issue

I went through the whole DataGrid documentations and couldn't figure out how we can display sting in multiple lines without ellispis inside a cell. This is the behaviour i am getting:

enter image description here

This is how I wanted:

enter image description here

Th string should extend to the second line if it is too big to be displayed in a single line. I have added width, minWidth and maxWidth column properties to this column. These are the properties of the column:

field: item.name,
headerName: item.display,
hide: item.hidden
width: 200, 
minWidth: 50, 
maxWidth: 300

Please let me know if there is any way to achieve this.


Solution

Adding this property to the DataGrid solved the issue:

getRowHeight={() => 'auto'}


Answered By - Jayesh Babu
Answer Checked By - - David Goodson (ReactFix Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Newer Post Older Post Home

Featured Post

Is Learning React Difficult?

React is difficult to learn, no ifs and buts. React isn't inherently difficult to learn. It's a framework that's different from ...

Total Pageviews

Copyright © ReactFix