WPF Flexgrid Last column/row border issue

Posted by: david on 26 June 2025, 8:11 am EST

    • Post Options:
    • Link

    Posted 26 June 2025, 8:11 am EST - Updated 26 June 2025, 8:17 am EST

    Hi

    I am using wpf flexgrid, could not get the borders for last column and last row as shown in the image.

    Please help.

  • Posted 27 June 2025, 1:04 am EST

    Hi David,

    You can create custom GridCellFactory for the FlexGrid and override its PrepareCell method to increase the thickness of last row and last column borders. Here is the code snippet to do so:

    public override void PrepareCell(GridCellType cellType, GridCellRange range, GridCellView cell, Thickness internalBorders)
    {
        if (range.Row == Grid.Rows.Count - 1)
        {
            // For the last row, increase the bottom border by 3
            internalBorders = new Thickness(
                internalBorders.Left,
                internalBorders.Top,
                internalBorders.Right,
                internalBorders.Bottom + 3
            );
        }
        if(range.Column == Grid.Columns.Count - 1)
        {
            // For the last row, increase the right border by 2
            internalBorders = new Thickness(
                internalBorders.Left,
                internalBorders.Top,
                internalBorders.Right + 2,
                internalBorders.Bottom
            );
        }
        base.PrepareCell(cellType, range, cell, internalBorders);
    }

    Kindly refer to the attached sample for full implementation. See WpfFlex.zip

    Thanks & regards,

    Aastha

Need extra support?

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

Learn More

Forum Channels