Flexgrid NET6

Posted by: kisar on 26 January 2023, 2:57 am EST

  • Posted 26 January 2023, 2:57 am EST


    im migrating my applivation from framework to net7

    hi have now your last library and i noticed that

    many things has changed from my version in the flexgrid component

    so i start asking my first question :

    1. BINDING:

      <c1:Column Width="60"  Binding="{Binding krecord_base.kid}">
                                           <TextBlock Text="{Binding kbinding_language.kgrid_col_id}" Style="{x:Static Kisar_lib_app_wpf:KAppResources.kcontrol__listview__header_text__style}"/>

    this is code as i used to bind the previous flexgrid,

    the flexgrid is connected through the viewmodel

    now i saw that for the main binding i can write directly : <c1:Column Width=“60” Binding=“krecord_base.kid”>

    but i did not find solution for the header binding and the header style


      i did not find equivalend of “SortedColumn” event

      in my version i used to solve a problem :

      if i had that 3^ row selected and the user sort a column

      after the sorting the previous row does not remain selected

      but (very danger) it is selected the 3^ row in the new order

      I dont know if exists anymore the problem, but is there a manner to have a SortedColumn" event?


    i did not find any way to do this :



    the flexgrid is connected through the viewmodel

    if i use in the itemsource always connected it works very slow in case of many rows :

    viewmodel search:

    var array=getData();
    	        foreach (var item in array)
                    	this.kbinding_grid__itemssource.Add(new TRecord_search(item));

    100’000 records > 28 sec

    if i act in the wpf form


    100’000 records > 7 sec

    So, i know that this is a general problem and not specifically of the flexgrid

    but in the framework i found a component ObservableCollectionEx that solved the problem,

    now with NET6 version of flexgrid it throw exception of index out of range…

    I would ask you if the flexgrid has some solution for this problem

    Thank you


  • Posted 28 January 2023, 5:21 am EST


    Thanks for reaching out to us with your query.

    1. C1Flexgrid Framework and Net6 Flexgrid have different architechtures. FlexGrid Net6 uses GridColumnHeaderCell to create a ColumnHeader content. To achieve your requirement, you can override BindCellContent of GridCellFactory.
    public override void BindCellContent(GridCellType cellType, GridCellRange range, FrameworkElement cellContent)
        base.BindCellContent(cellType, range, cellContent);
        if (cellType == GridCellType.ColumnHeader & range.Column == 0)
            var s = cellContent;
            Binding binding = new Binding("HeaderText");
            cellContent.SetBinding(GridColumnHeaderCell.TitleProperty, binding);
    1. We have raised an enhancement to the development team to support Sorted event.[Internal tracking Id - C1XAML-31061]

    2. You can use Binding property for the same.

    1. We are unable to replicate this issue at our end. Could you please provide a small sample. So, that we can investigate and assist you accordingly.

    Please refer the sample: DynamicBinding.zip

    Best Regards,


  • Posted 29 January 2023, 3:45 am EST

    ABOUT 1.

    thank you, i understand now how i can bind the header text,

    but if i want to bind a template xaml? is it possible?

    is it possible to customize also the cell content with a xaml template?

    however in my opinion this new solution is not very convenient,

    because it forces me to work on two different levels, xaml and code,

    while before the flexgrid could only be managed by xaml.

    Is there any option for the future?

    ABOUT 4.

    i attached a very simple example,

    on the left side ther’s the flexgrid itemssource alwais connected while searching,

    on the right side ther’s the flexgrid itemssource disconnected-search-connected,

    how you can see ther’s a big difference.

    It would be very usefull to have a way to tell to the flexgrid through binding

    • suspend UI
    • refresh UI


  • Posted 29 January 2023, 11:47 pm EST - Updated 30 January 2023, 10:19 pm EST


    1. FlexGrid Net6 uses GridColumnHeaderCell to render the ColumnHeaders. The template is already applied to it. Also, updating HeaderColumn Binding through CodeBehind is the only way.

    4 We have replicated this issue at our end. We have escalated it to the development team. Will inform you once we have any update from them.[Internal Tracking Id - C1XAML-31082]



  • Posted 30 January 2023, 10:38 pm EST


    1. FlexGrid delegates sorting to data-collection, therefore there is no api in FlexGrid, but it can be used the data-collection api.(see code snippet)
     private void OnSort(object? sender, EventArgs e)
         Debug.WriteLine("Sort Fires");

    Please refer the attached sample for full implementation: FlexGridSort.zip

    Best Regards,


Need extra support?

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

Learn More

Forum Channels