Datagrid autofit column width based on content, and freeze datagrid header when scrolling

0
Hi Experts, Is there a way to Datagrid autofit column width based on content, and freeze datagrid header when scrolling? Perhaps using custom class? Cheers!
asked
2 answers
1

use the below code where you can add a class name to the datagrid as d1 nad use below properties

 

.d1 .mx-name-head-row{

  position: sticky;

  top: 0px;

  background-color: #f7f3ff !important;

}

it will work.

 

answered
1

Download marketplace module Atlas3Extras and have a look at https://service.mendixcloud.com/p/demodatagridextras for an example of a sticky header.

You can either copy the solution, but the easier option is importing the module into your app and adding class 'sticky-header' to your datagrid.

Hope it helps.

answered