Row Number on firts column - WPF FlexGrid

Posted by: mcpugo on 19 September 2017, 1:55 am EST

    • Post Options:
    • Link

    Posted 19 September 2017, 1:55 am EST

    Hi!

    How can you show the row number on the first column of the FlexGrid for WPF.

    Thanks in advance.

  • Posted 19 September 2017, 1:55 am EST

    Hello,

    Please refer to the following link wherein similar query has been answered in Windows Phone :

    http://our.componentone.com/groups/topic/flexgrid-display-row-number-in-first-column/

    You can implement the same in WPF and share your observations on the same.

    Hope it helps.

    Regards,

    Reema

  • Posted 14 September 2021, 8:29 am EST

    Do we have a sample for the .NET 5 version of the FlexGrid. The link in the previous reply does not work.

    Thanks,

    Felix

  • Posted 14 September 2021, 9:22 pm EST

    Hi,

    You can show row number in .Net 5 Flexgrid’s RowHeader Column by overriding PrepareCell method of GridCellFactory as :

    
    public override void PrepareCell(GridCellType cellType, GridCellRange range, GridCellView cell, Thickness internalBorders)
            {
                base.PrepareCell(cellType, range, cell, internalBorders);
                if (cellType == GridCellType.RowHeader & cell.Content is TextBlock)
                {
                    var txt =cell.Content as TextBlock;
                    txt.Text = (range.Row + 1).ToString();
                }
            }
    
    

    Please refer the attached sample for the same : FlexgridRowNumberDemo.zip

    Best Regards,

    Nitin

  • Posted 15 September 2021, 12:05 am EST

    Thanks Nitin, I will give it a shot.

    Felix

Need extra support?

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

Learn More

Forum Channels