In C1.TrueDBGrid using SetDataBinding directly calling BeforeRowColChange

Posted by: prana29 on 19 June 2025, 6:57 am EST

    • Post Options:
    • Link

    Posted 19 June 2025, 6:57 am EST - Updated 19 June 2025, 10:41 am EST

    When calling SetDataBinding method it is directly calling BeforeRowColChange and OnRowColChange Event when give the exception error or sometime not loaded the Bounded data. There is way not calling these event before data is Binding successfully. Last version we have used v2009 and now we have upgraded in 4.8 version.

  • Posted 20 June 2025, 3:03 am EST

    Hello,

    We created a simple sample binding data to TrueDBGrid using the SetDataBinding() method but could not observe any issues. Both the BeforeRowColChange event and the OnRowColChange() method are being called but it yields no error.

    Could you please update the attached sample or attach a stripped-down sample of your project for us to investigate?

    Sample: TrueDBGrid_SetDataBinding.zip

    Regards,

    Uttkarsh.

  • Posted 24 June 2025, 8:11 pm EST

    To clarify, our project was originally built using ComponentOne version 2.1.20093.120, and after a long interval, we recently upgraded to version 4.8.20251.709.

    Following this upgrade, we’ve encountered an issue: calling the SetDataBinding() method on the grid now triggers the BeforeRowColChange or RowColChange event immediately - even before the data binding completes. This behaviour did not occur in the earlier version, where these events were not triggered during the binding process.

    This change is causing unintended side effects in our application logic, particularly where certain operations are expected to occur only after the data has been fully bound.

    We’d appreciate it if you could confirm whether this is expected behaviour in the newer version and, if so, whether there is a recommended approach to suppress or defer these events until the binding process is complete.

  • Posted 25 June 2025, 12:41 pm EST

    Hello,

    We have forwarded your concerns to the development team for their insights on the change in behavior. [Internal Tracking ID: C1WIN-34197]

    Rest assured, we’ll get back to you once we have more information.

    To work around this behavior, you can use a boolean flag to determine when data binding is being set. Please refer to the attached modified sample for implementation.

    Sample: TrueDBGrid_SetDataBinding_Mod.zip

    Regards,

    Uttkarsh.

  • Posted 25 June 2025, 5:18 pm EST

    Thank you for your reply, Uttkarsh.

    There are many TrueDBGrid controls in our application, and applying this workaround to all of them would be difficult. We would appreciate a universal solution.

    Best regards,

    Igor Prolis

  • Posted 26 June 2025, 5:04 am EST

    Hello Igor,

    We’re sorry, but the solution depends on your project’s architecture and how things are implemented. For example, if you’ve created a custom TrueDBGrid and used it as a base for your other grids, you can simply apply the workaround in that base grid.

    Previously we’ve just shared an idea to help work around the issue you’re experiencing. Implementation will depend on your project’s structure.

    If you can share details about how you’re using TrueDBGrid in your project, that would help us provide a more specific solution.

    If the details are private, feel free to open a ticket on our private portal and share them there.

    Regards,

    Uttkarsh.

  • Posted 26 June 2025, 11:29 pm EST

    Hello Uttkarsh,

    We’re currently using an extension flag called IsBinding (since we don’t have a custom TrueDBGrid) to prevent the BeforeRowColChange and RowColChange events from being triggered. Please see the attached sample for implementation details. Appreciate your advice on this.

    TrueDBGrid48.zip

    Thank you,

    Loc Lai

  • Posted 27 June 2025, 7:00 am EST

    Hello Loc,

    Thank you for providing the updated sample. We’re able to observe the behavior as well.

    It seems that while binding data to the grid, the RowColumn is forcefully updated, which triggers both events, as the e.Cancel property works fine in normal conditions.

    As a workaround, we recommend skipping the event handler using the flag.

    Regards,

    Uttkarsh.

  • Posted 4 July 2025, 1:26 am EST

    Hello,

    As per the development team, there were several fixes related to RowColChange and SetDataBindings between 2.1.20093.120 and 4.8.20251.709.

    So, possibly your program uses incorrect behavior fixed in one of the fixes in between. To ensure consistent behavior with the current version, we recommend incorporating the workaround we suggested.

    Regards,

    Uttkarsh.

Need extra support?

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

Learn More

Forum Channels