Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
620
Grid - Auto adjust columns width based on content length
posted

I'm developing a web application and I'm using a lot of grid. I'm trying to avoid having a lot of customization for each one of them. I'd like that the grid set each column's initial width based on the content. I. e.:

Short name      Name
JF                  John Foo
AB                 Ana Bar

All values for 'Short name' are 2 chars long, and the longest value for 'Name' is 'John Foo' with 8 chars. So in this case, the grid should set 'Short name' column's width to 20%, and 'Name' column's width to 80%.

In case this functionality does not exisist, could you give me some clues so I know where to start building it?

Thanks,
Diego