Back To Blogs
Luke Cassar 6th Jul 2021

Mendix Data Grid 2 – powerful new features & settings

Mendix 9 is here, and one new feature I keep hearing about is data grid 2, a completely new version of the data grid widget that offers more flexibility and functionality than its older brother.

I was determined to find out what this new data grid can do out of the box, and if it is a viable replacement for the original. Now, do keep in mind that at the time of writing, it is still in development so any cons I might highlight could very well be addressed by the time you read this but I quickly found that the added functionality in data grid 2 makes it more than just a replacement for the standard data grid widget. It can also be used as a listview or datagrid thanks to the custom content columns (more on those later) but, for the purposes of this blog post, we will be looking exclusively at it as a data grid.

My initial approach was to try to replicate as much of the original data grid’s functionality as possible. I soon realised this was not the right method when I discovered that in data grid 2 there are no header buttons, such as the automatically generated New, Edit and Delete buttons in data grid, and there is no way to select a row. A consequence of not selecting a row is that other widgets cannot “listen to widget” so it became clear that simply replicating the existing functionality would not be playing to data grid 2’s strengths. There is an on click action, so it is possible to replicate some of this behaviour using a non-committing entity to select rows and use that in a data source microflow, but this solution felt inelegant.

It was at this point I needed to start looking into the new features of data grid 2 to really understand what it can (and is designed to) do. Columns can be of three types: Attribute, Dynamic Text and Custom Content:

  • Attribute speaks for itself, it’s how columns work in the data grid.
  • Dynamic Text is a great time saver, as it lets you combine attributes, or customise how they appear in the column, something previously possible with calculated fields or other methods, but it’s great not having to jump through hoops anymore.
  • Custom Content is where it gets exciting! Custom content can be literally anything, it is essentially a little data view in your grid. You can use it to add action buttons (in line edit and delete buttons!), display pictures, and so much more!

While I do miss the header buttons, it is generally agreed that less clicks to get something done leads to a better user experience, so having inline buttons is a nicer solution to having to select a row, and then click a button in the header. That said however, you will have to think carefully about avoiding too much clutter. It was easier to fit more buttons in the header than to have them repeated in every row.

Another big feature is the new filtering system. Rather than selecting a filter type (textfield, drop down etc), with a single comparison type (equal too, greater than etc) and attribute, you can now drop in a filter widget of the appropriate filter type into a column, to make it match that attribute, and let the user determine what comparison type to use. This means no longer needing multiple date fields for a greater than and less than comparison. The end user is empowered to customise their search on the fly. And the filters being their own widget opens up endless possibilities, if you wish to allow filtering in a unique way, you can create your own filter widget, or find a new one in the marketplace. I imagine it won’t be long until we start seeing some very clever data grid filter widgets available for download!

Speaking of customisation, it is also possible now to allow the end user to customise the data grid in ways the original could not allow. In data grid the user could resize columns, but that is about it. With data grid 2, they can rearrange column orders, and even show and hide columns. It is a shame, however, that there seems to be no option for the user to hide the search filters. It is also possible to store each user’s customisations to the data grid in a string attribute, so the changes can persist between sessions. Should you not want to give the user too much power, you can also limit the customisation options they have access to.

I initially set out to ask and answer a very specific question with this blog entry: Can I (and should I) replace all data grids in my app, and retain the same functionality? To answer that question, no… but why would you want to keep the same functionality when it could be so much better? Replacing the original data grid with data grid 2 will require some redesign of your pages and functionality, but ultimately it will be worth it. Data grid 2, is more aesthetically pleasing, allows for far more functionality in your data grid columns and empowers the end user to customise their experience according to their specific needs. When starting out writing this entry I was prepared to write off the new data grid as something worth keeping an eye on but perhaps not using yet, however in the process of actually using it I’ve come to the conclusion that it absolutely should be your primary data grid widget going forward and is packed full of exciting and powerful new features and settings.

Related Blogs


Mendix low-code fundamentals – applying application security

Looking to ensure secure application development? Episode 3 of our Mendix Fundamentals Series describes how security rules can be applied and helps you understand the basic security principles within the Mendix low-code application development environment.

Find Out More

Mendix low-code fundamentals – building the pages of your application

Episode 2 features Mendix developer Luca Santese demonstrating how to build Pages and create an engaging front-end for your Mendix low-code application!

Find Out More

Mendix low-code fundamentals – creating the domain model

Our new Mendix Fundamentals Series contains explanations and walkthroughs of some of the key concepts used in the Mendix low-code development platform. Across the four-part series, AuraQ’s team of experienced Mendix developers will cover the essential features required to build an effective Mendix application including the domain model, pages, security and microflows.

Find Out More

Leveraging machine learning capabilities in application development

In recent years, the digital sector has been transformed by artificial intelligence (AI). With tools such as ChatGPT and DALL-E, public access to AI resources is at an all-time high.

Find Out More

Git integration in Mendix

Mendix has chosen Git as their standard for version control going forwards. Explore some of the differences between using Git and SVN and walk through how developers use Git version control when creating both new applications and when converting existing Mendix applications.

Find Out More
Drag