Turn of sorting by header in data grid

Is it possible to turn off the sorting by header on a datagrid? Currently if you click on a header (in a standard datagrid) it will asc/desc sort based on that collumn. Is it possible to turn this feature off?
3 answers

Hi Niels,

It is not possible to disable the sorting possabilities of a datagrid column.

If you know the resultset is always small, a workaround could be to retrieve the data using a microflow instead of using XPath. When data is retrieved with a microflow a datagrid is unable to filter and sort the data. Be aware that when your resultset is very large this will cause performance issues.


It is as mentioned previously, sorting can’t be disabled on a datagrid using Mendix till now. However, this can be done using CSS. You will need to set the pointer event property to none. Below is the definition of the class “datagridwithoutsorting ” that should be used on the datagrid that you want to disable sorting on.

.datagridwithoutsorting th { /* disabling pointer events */
    pointer-events: none;
.datagridwithoutsorting .mx-datagrid-column-resizer { /* enabling the column sizer */
    pointer-events: auto;



A cleaner approach is to add a calculated attribute returning the same value as the stored attribute. In Data Grid 1 clicking on a calculated attribute column header does not cause sorting