Control the row height of a merge row

Posted by: Ranba790 on 25 July 2018, 5:15 am EST

    • Post Options:
    • Link

    Posted 25 July 2018, 5:15 am EST - Updated 4 October 2022, 2:26 am EST

    Hi

    Any way to control the height of a merge row

    In the image i have my grid, i would like to make the middle row is is a merge of 3 the

    same height as the other 2 rows

    Thanks

  • Posted 26 July 2018, 7:16 am EST

    Hi,

    *I am assuming you are using C1FlexGrid.

    Now, for customizing the height of merged row, you may use OwnerDrawCell event and inside check if GetMergedRange returns SingleCell/not. If it does not return SingleCell that means that the cell is part of a merged range and you can then change the height of that row as shown in below code snippet:```

    private void _flex_OwnerDrawCell(object sender, C1.Win.C1FlexGrid.OwnerDrawCellEventArgs e)

    {

    if(!e.Measuring)

    {

    var test = _flex.GetMergedRange(e.Row, e.Col);

    if (!_flex.GetMergedRange(e.Row, e.Col).IsSingleCell)

    {

    _flex.Rows[e.Row].Height = 100;

    }

    }

    }

    Thanks,
    Ruchir
Need extra support?

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

Learn More

Forum Channels