Item Formatting in the .Net 6 .0 WPF Flexgrid

Posted by: rambabu on 15 May 2023, 6:01 am EST

  • Posted 15 May 2023, 6:01 am EST


    I have a requirement to show a check box or Textblock in the WPF flex grid column based on a few conditions. can you please let me know how to implement this?

    do we have any methods like item formatter similar to what we have on the web (wijmo)?

  • Posted 16 May 2023, 5:29 pm EST

    Hi Rambabu,

    You can extend Flexgrid’s GridCellFactory class to create checkbox or textblock in a column based on some conditions. We have created a sample application for your reference where have created Checkbox/textblock control in the last column of the flexgrid by applying some condition on the price column. We have to override GridCellFactory’s GetCellContentType, CreateCellContent, BindCellContent and UnbindCellContent method to implement the functionality.

    Kindly refer to

    Please let us know if you have any further concerns regarding this.

    Thanks & Regards,


  • Posted 25 May 2023, 4:39 am EST

    Hello Aastha,

    I tried to implement using the GridCellFactory, but I am facing an issue with formatted column values, the cell values are changing when I have a vertical scrollbar and when I scroll down to the grid, I attached a video for reference and the code used for formatting.

    Please let me know how to resolve the issue

  • Posted 26 May 2023, 9:56 pm EST

    Hi Rambabu,

    Thanks for providing the sample.

    We are analyzing your sample and working towards the solution of your issue. We will update you soon on this.

    Thanks & Regards,


  • Posted 29 May 2023, 12:32 am EST

    Hi Rambabu,

    In the provided XAML code, there is a column named ‘Test’ with its Binding property set to “Test”. However, if the Customer class does not currently contain a property named “Test”, it seems that an update to the data model is necessary.

    If you have not added a property named “Test” to the Customer class, we have made a modification to the XAML code as follows:

    <c1:GridColumn Header="Test" Format="N1"/>

    However, if you have indeed made changes to the data model and added a “Test” property, please provide the relevant code so that I can assist you further.

    In your application, you are creating a checkbox column. It is advisable to utilize XAML data templates to define the cell template for bound columns. For more detailed information on how to implement this approach, you can refer to the provided resource.


    The CreateCellContent method is responsible for generating the content of a cell, while the BindCellContent method is used to set the actual data in the cell. However, since the data in your custom column is not bound, it is recommended to override the PrepareCell() method instead. This method is invoked for all the cells within the viewport and allows you to create the cell view accordingly. By overriding PrepareCell(), you can customize the cell’s appearance and content based on your specific requirements.

    Kindly refer to the attached sample for full implementation. ( See

    Please let us know if you have any further concerns regarding this.

    Thanks & Regards,


Need extra support?

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

Learn More

Forum Channels