Well the quickest way is to make multiple datagrids and show or hide them with coditional visibility per userrole.I
If you want the user to hide or show the columns themselves you could use this widget: https://appstore.home.mendix.com/link/app/2702/ bit harder to implement though.
@monali, There is no options to set the visibility in the data-grid column’s. Instead, You could have various data-grid’s of the same entity reference by specifying the exact user role. So that you can have selected column’s in the every data-grids.
It cannot be done in the single Data grid for multiple user roles.
Can be done by adding individual data grids for each user role.
Check the following link, hope it might be helpful. Which is about to use Data grid extension widget =>