Hiding dynamic column and adjustment of width of dynamic columns in wijmo grid

Posted by: nivishapanwar on 5 November 2020, 2:38 am EST

    • Post Options:
    • Link

    Posted 5 November 2020, 2:38 am EST

    Hello,

    Issue 1:

    After binding the json data into the grid, 4 columns are visible, but according to the UI only 2 columns should be visible.

    Issue 2: How can we adjust the width of dynamic columns

    Issue 3: How can we hide the column name of the dynamic column

    Can I please get some help regarding these issues.

    Thanks

  • Posted 6 November 2020, 9:49 am EST

    Hi Nivisha,

    Please refer to the following responses:

    1). To be able to generate column according to your requirement you may assign a column info array during the initialization of the grid like:

    var theGrid = new FlexGrid(‘#theGrid’, {

    autoGenerateColumns: false,

    columns: [

    { binding: ‘country’, header: ‘Country’, width: ‘2*’ },

    { binding: ‘sales’, header: ‘Sales’, width: ‘', format: ‘n2’ },

    { binding: ‘expenses’, header: ‘Expenses’, width: '
    ’, format: ‘n2’ }

    ],

    itemsSource: data

    });

    You may also refer to the following demo: https://www.grapecity.com/wijmo/demos/Grid/Data-binding/Basics/purejs

    Refer to the following doc for more information: https://www.grapecity.com/wijmo/docs/Topics/Grid/Columns/Configuring-Columns

    2). To set the width you may set the use the width property of the column. Please refer to the following demo:

    https://www.grapecity.com/wijmo/demos/Grid/Columns/ColumnWidth/purejs

    3). To hide the header/column name, you may set the headersVisiblity property to “Row”.

    https://www.grapecity.com/wijmo/api/classes/wijmo_grid.flexgrid.html#headersvisibility

    Regards

    Sharad

  • Posted 6 November 2020, 10:03 am EST

    Thank you for the help Sharad.

Need extra support?

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

Learn More

Forum Channels