FlexGrid - auto size column width

Posted by: zolotoy on 14 September 2017, 11:10 am EST

  • Posted 14 September 2017, 11:10 am EST

    Is it possible to have Flexgrid sizing its columns automatically?

    Thanks

  • Posted 14 September 2017, 11:10 am EST

    You mean sizing the columns after editing?

    If that is what you want, you can add an event handler to the cellEditEnded event and call autoSizeColumn.

    This fiddle demonstrates:

    http://jsfiddle.net/Wijmo5/266z6j4s/

  • Posted 14 September 2017, 11:10 am EST

    No, I did not mean that. I meant when data is shown initially each column would have a width that allows showing the widest text in the column.

  • Posted 14 September 2017, 11:10 am EST

    That’s even easier. Call “autoSizeColumns” from the “itemsSourceChanged” event.

    Here’s a fiddle:

    http://jsfiddle.net/Wijmo5/4LrL0cc5/

  • Posted 20 September 2018, 7:29 pm EST

    This doesn’t seem to work when I define my columns in HTML









Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels