232
Views
4
Comments
Set the column width in Data Grid
Application Type
Reactive
Service Studio Version
11.54.40 (Build 63053)
Platform Version
11.14.0 (Build 34092)

Does any one know how to a data grid according to the row’s content and ignore the header content? The default column width setting is according to the width of the header content. In my case, the header is much longer than the rests in the rows:


I'd like to set the column width according to the rows' content but not to the headers like the screenshot below:

I read OutSystems.GriAPI, but not find a way to achieve the above. 

UserImage.jpg
LarryF

Thank you Sunil to put this post. I saw this but it's not sufficient for my case. The given code can set column width for both table header and table body homogenously, but my case wants to set whole column width according to the table body's width. I could not find a way to set width only on the table body and let the header follow to it.  

2021-01-18 14-56-14
Guilherme Gregorio

Hello Larry, 

I did some tests and I think I got the behavior you are looking for...

I just created classes to place in the header cells and row cells, "th" for header and "tr" for rows...

I'll attach the file with the example I made, I hope it helps...

TestWidthColumn.oml
UserImage.jpg
LarryF

Thank you Guilherme. It can distinguish th and td in table, but the question is using data grid, every elements are div. 

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