C1FlexGrid CellEditending (e.cancel = true) causing problem after upgrading

Posted by: abdul.muqsit on 15 December 2021, 7:59 pm EST

  • Posted 15 December 2021, 7:59 pm EST

    Hi.

    we are using componentOne WPF Edition (older version).

    So we are trying to upgrade controls one by one.

    We upgraded the Dlls of C1.WPF.FlexGrid.4 to C1.WPF.FlexGrid.4.5.2(latest) version.

    After upgrading the Dlls we are having problems with C1FlexGrid in edit mode.

    Scenario:

    we are using bridge objects for Databinding with each of the grid cells. so there we capture CellEditEnding Event and cancel so that the bridge object doesn’t get replaced by the value which has been typed in the cell and upon hitting (enter key) we set the focus to the Cell Below.

    // this keeps the cell from replacing the bridge object with the values that are typed in. Don’t remove it!!! //

    this.CellEditEnding += (s, e) =>

    {

    e.Cancel = true;

    };

    this was working fine in the previous version but after upgrading to the latest FlexGrid this is not happening focus does goes to the cell below. it’s because

    when we do e.cancel = true it seems that CreateCellContent is not called while in the previous version it was being called.

    so if we do e.cancel = false then overidden createCellContent in our custom factory is called in the latest version but then the bridge Object is replaced by the value typed in the cell which breaks our code.

    Please guide what can be the solution or are we missing something ?

  • Posted 16 December 2021, 3:32 pm EST

    Hi,

    Thank you for reaching out to us with your query.

    The behavior experienced by you in the latest build is logically correct as the cell is still in an editing state (e.Cancel = true) due to which it will not go to another cell on clicking enter until the cell editing is completed for that cell.

    However, I escalated your query to our developer team as well for more information. I will let you know when I will get anything.

    ID : C1XAML-28549 [For internal use only]

    Thanks,

  • Posted 16 December 2021, 8:43 pm EST

    if we do e.cancel = false then please can you guide how to prevent the bridge object from being replaced by the value which has been typed in. when the value is replaced it breaks our code.

    and your quick response will be appreciated as we are doing a POC for upgrading to the latest version so we are using latest trail version for POC.

    Thanks,

  • Posted 20 December 2021, 7:48 pm EST

    Any Updates on this ?

  • Posted 20 December 2021, 8:40 pm EST

    Hi Abdul,

    We are working on it on a higher priority and will get back to you as soon as possible.

    Best Regards,

    Kartik

  • Posted 21 December 2021, 9:15 pm EST

    Hi,

    Please note, we are discussing your issue with our developer team. We will update you with the result as soon as possible.

    In the meantime, you can use Flex Grid’s PreeCellForEdit and CellEditEnding events to prevent the data source from being replaced with a typed value.

    ```
    

    private void Grid_PrepareCellForEdit(object sender, CellEditEventArgs e)

    {

    value = ((e.Editor as Border).Child as C1FlexComboBox).Text;

    }

    private void Grid_CellEditEnding(object sender, CellEditEventArgs e)
    {
        ((e.Editor as Border).Child as C1FlexComboBox).Text = value;
    }
    
    
        Also, set the Update Source Trigger as Explicit.
        ```
    <c1:Column Header="Property1" Binding="{Binding MyProperty1,Mode=TwoWay,UpdateSourceTrigger=Explicit}"/>
    

    Also, find a sample application attached.

    Hope, it will work for you.

    Regards,

    BridgeObject.zip

  • Posted 20 January 2022, 9:54 pm EST

    Any Feedback From your Developers ??

  • Posted 24 April 2022, 9:29 pm EST

    Hi Abdul,

    Apologize for the delay in response.

    It seems like you have created duplicate case. Hope you have got the solution in Case: CAS-27529-J8D7Q4.

    JFYI, This issue has been fixed with the latest build 2022v1.

    So, we would request you to upgrade to the latest build using ComponentOne control panel. Just in case if you don’t have the latest ComponentOne Control Panel, you can download it from https://www.grapecity.com/componentone/download.

    Best Regards,

    Nitin

Need extra support?

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

Learn More

Forum Channels