157
Views
5
Comments
Solved
[OutSystems Data Grid] Set Column Width in percent or Autoset Column width to fill the grid
Question
outsystems-data-grid
Reactive icon
Forge asset by OutSystems

Hi


Is it possible to get the columns to autofill to the grids width, or be able to set a percentage value on the grids width?

It would be to prefer to avoid a gap in the screen between the last column and the visible area of the grid, and to make it easier to set up a grid for different screen resolutions.


Regards

Bård

2022-09-16 08-04-04
Bruno Martinho
Staff
Solution

Hello @Bård Indredavik

In order to have the columns with Auto width, you can achieve it, using some JS in the Grid onInitialize event.

Please take a look at this forum post:

https://www.outsystems.com/forums/discussion/71782/change-default-column-width/

This has a sample OML that you can check.

Please let us know if this helps and if not, give some more details so we can try to help.

Thanks,

Bruno Martinho

UserImage.jpg
Bård Indredavik

Thank you very much, that works fine both with autogenereted grid and "manual" set up of columns. Added minWidth in additon in the js and those two gets our wanted functionality. To have this option directly on the column config would be great, for example setting width="*", and a minWidth=x.

2020-06-10 05-06-30
shehroze khan

Hi  Bård Indredavik,

Try using width column to fill, it will fill the column width no spacing will be shown.

Thanks 

Shehroze khan

Screenshot width.png
2018-08-03 14-17-33
Carlos Escórcio

shehroze khan : Like these? and those 2 container with Fill in Width dropdown?

UserImage.jpg
Bård Indredavik

Hi


I did not quite understand what you meant @shehroze khan . How can I set the width to "fill" in the reactive grid? I have tried with containers around the columns with no luck.


Regards

Bård

2022-09-16 08-04-04
Bruno Martinho
Staff
Solution

Hello @Bård Indredavik

In order to have the columns with Auto width, you can achieve it, using some JS in the Grid onInitialize event.

Please take a look at this forum post:

https://www.outsystems.com/forums/discussion/71782/change-default-column-width/

This has a sample OML that you can check.

Please let us know if this helps and if not, give some more details so we can try to help.

Thanks,

Bruno Martinho

UserImage.jpg
Bård Indredavik

Thank you very much, that works fine both with autogenereted grid and "manual" set up of columns. Added minWidth in additon in the js and those two gets our wanted functionality. To have this option directly on the column config would be great, for example setting width="*", and a minWidth=x.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.