Forums

Find answers, ask questions, and connect with our
community all around the world.

Home Forum Omnis General Forum Assign dynamic column width

Tagged: 

  • Assign dynamic column width

    Posted by Martin Obongita on November 5, 2023 at 9:56 pm

    In Omnis 10.22 JS forms, we assign the width of columns for datagrid objects with this command:

    Do $cinst.$objs.DataGrid.$::columnwidths.$assign(‘100,300,200′)

    Is there a way to assign this dynamically? I have tried the method below but it fails:

    Declare variables:

    lCols1 Type Integer 32bit

    lCols2 Type Integer 32bit

    lCols3 Type Integer 32bit

    CalcCols:

    Calculate lCols1 as 100

    Calculate lCols2 as 300

    Calculate lCols3 as 200

    Do $cinst.$objs.DataGrid.$::columnwidths.$assign(‘lCols1,lCols2,lCols3’)

    Martin Obongita replied 5 months, 3 weeks ago 2 Members · 2 Replies
  • 2 Replies
  • Giacomo Manzoli

    Member
    November 6, 2023 at 7:19 am

    Have you tried with

    Do $cinst.$objs.DataGrid.$::columnwidths.$assign(con(lCols1,',',lCols2,',',lCols3))
    • Martin Obongita

      Member
      November 6, 2023 at 8:15 am

      That worked as expected. Problem solved. Thank you so much @Giacomo Manzoli .

Log in to reply.