FlexGrid Change Column height

Posted by: kun.leeing on 30 May 2019, 11:58 pm EST

    • Post Options:
    • Link

    Posted 30 May 2019, 11:58 pm EST

    Hi experts,

    May I ask how can I change the Column’s height in wj-flex-grid?

    Have tried to put on css on column’s cell and add class to

    <wj-flex-grid-column *ngFor=“let col of dynamicColumns”

    [binding]=“col.binding”

    [header]=“col.header”

    [visible]=“col.visible”

    [width]=“col.width”

    class=“max-height”

    >

    both did not work.

    Could someone give a clue on this?

    Thanks

  • Posted 3 June 2019, 5:44 am EST

    Hi Kun,

    As part of the design, you cannot set the height of a specific column. What we need to do is set the height for the rows.

    Please refer to the following code snippet:

    <wj-flex-grid #grid [itemsSource]="data" (initialized)="initGrid(grid)">
    </wj-flex-grid>
    
    /* equivalient initGrid menthod */
    initGrid(grid){
    	/* set height of all the rows */
    	grid.rows.defaultSize = 50;
    	/* set heighr of a specific row */
    	grid.rows[row_Index].height = 70;
    }
    
    

    Further, to apply a class to a single column, we would recommend you use the cssClass property of the column instead of setting a class attribute in markup.

    Please refer to the link that demonstrates how you can use cssClass property:

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

    API Reference:

    • cssClass: https://www.grapecity.com/wijmo/api/classes/wijmo_grid.column.html#cssclass

    • defaultSize: https://www.grapecity.com/wijmo/api/classes/wijmo_grid.rowcollection.html#defaultsize

    • maxSize: https://www.grapecity.com/wijmo/api/classes/wijmo_grid.rowcollection.html#maxsize

    Regards

  • Posted 5 June 2019, 11:51 pm EST

    Thanks so much, Sharad. :slight_smile:

Need extra support?

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

Learn More

Forum Channels