cell styling for grouped decimals in datagrid2

0
Hi Community, I have a question about how I can get grouped digit styling working in cells with decimal numbers in them. In the old datagrid we can set these with options in the grid column settings. I can’t find that in the new datagrid2. Is there a css class we can assign in the appearance tab (which one in that case? Is there already a css class, or do I need to make one? (in which case, any suggestions on what that would be code-wise?) If I cannot do this with styling, then what other approach should I look into? I’ve seen the dynamic text one where I guess I could use some standard formatting functions to convert the decimals into strings with formatting options etc., but is that the right way?
asked
1 answers
14

Figured it out!

It’s indeed in the dynamic text settings.

So, if you have a column with a decimal value in it, then you go to Edit the datagrid2 properties. Once in there, double click on the column in the columns list to open the Edit Columns Item popup.

Once that is open, set the Show: item to “dynamic text”. Then in the dynamic text field, click on edit and then enter {1} for the first parameter (I only wanted one, I guess you can do more than that with the classic dynamic text options).

Then in the Parameters table click on New and add the decimal attribute you want to display in the column. Use the Attribute (path) as option and select the attribute.

As you will see underneath, the formatting we were used to in the classic datagrid then is available for editing. There I used the Group Digits set to Yes, and voila, after a bunch of Ok’s and a recompile, the grid shows formatted decimal numbers.

Onward all, one more piece of knowledge gained (at least just for me, but I hope some of you also benefit).

 

I shall again say I am not the biggest fan of how Mendix has documented this. The documentation is very shallow, and it seems almost written by some super experts with the least amount of words, and then we newbies are left to experiment and figure things out. I wish Derek Roos or Johan de Haan read some of this and urged their documentation department into some kind of action to make more examples and more specific documentation additions for things we find out in this community and then only have available through posts like this.

Hopping off the soap box…..

 

answered