Flexgrid (Winforms VB) AfterEdit Event Not Firing

Posted by: mwebster on 29 November 2020, 5:21 pm EST

    • Post Options:
    • Link

    Posted 29 November 2020, 5:21 pm EST

    I have an odd issue. For some strange reason, the AfterEdit event is not firing when some of my Flexgrid cells are updated. I have a number of columns, all are set to allow edits. Some are text values, some have databound lists and some are numeric values. In all but four columns, making any kind of change to any of the values fired the AfterEdit event. In four columns (all four are decimal data types with C2 format) making a change does NOT fire the AfterEdit event. I have other columns with the exact same data types and they work just fine. No errors are returned. I placed a break-point on the AfterEdit event and it is never reached when any of those four columns are edited. I have even tried deleting the columns and re-creating them and the result is the same.

  • Posted 1 December 2020, 7:04 am EST

    Hi,

    We could not replicate the issue at our end. Please refer to the attached sample, if you are doing something else then please modify the attached sample so that we can help you better.

    Regards,

    Prabhat Sharma.

    FgAfterEdit.zip

  • Posted 1 December 2020, 10:16 am EST

    That is pretty much what I am doing. The odd thing is that I have multiple fields bound to the same database (different rows) and out of 29 columns, 25 work as expected. There is just a block of four columns (all databound, all allowing edits, all decimal data type) that do not fire the AfterEdit event after they are changed. I have gone line by line in the properties and compared everything between ones that work and ones that don’t and there is no difference that I can see.

  • Posted 1 December 2020, 10:54 am EST

    I figured out the problem. The four fields in question in the database table were set in the SQL Server query to default to 0 if they contained null values. E.g:

    IsNull(TotalCost, 0) as TotalCost

    In all of those cases, despite the actual underlying datatable not being directly edited by the FlexGrid, it treats those fields as some sort of read-only and changing them does not fire the AfterEdit event.

  • Posted 2 December 2020, 5:03 am EST

    Hi.

    I tried replicating the issue according to the information provided, but at my end AfterEdit fires in every case, even If I set a column to be read-only in DataSet and then set AllowEditing in the grid to true.

    Please refer to the sample attached. If possible, can you please provide us with a modified sample showing the issue so that we can assist you accordingly?

    Regards,

    Prabhat Sharma.

    FgAfterEdit1.zip

  • Posted 9 December 2020, 10:49 am EST

    Ok I will take a look and see if I can send you a sample.

Need extra support?

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

Learn More

Forum Channels