Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
685
UltraCheckEditor - dohhh!!!!!!!!!
posted

Have a checkbox on a form. "UltraCheckEditor"

It can be bound to datasource via Checked , CheckedValue or CheckState.

I chose "Checked".

Want to run an SQL query "before update".

I chose _BeforeCheckStateChanged but _ValidateCheckState may be good too.

Problem is that all these events seem to fire when loading the form and when changing records.

If I could find a way to determine change (e.g. like when comparing .text to .value) then I could make it all work in _BeforeCheckStateChanged.

How do I do this?

The query only really wants to be run when the box is checked by the user and not run for uncheck or systems events.

Please help!!!

Parents
No Data
Reply
  • 69832
    Suggested Answer
    Offline posted

    Since you don't have control over when the binding manager sets the value, you can't trap for setting of the control's value programmatically. You could, however, ensure that the control does not have the input focus before doing something that will trigger a change in the current record, and only running your query then:

    Example:
    private void ultraCheckEditor_CheckedChanged(object sender, EventArgs e)
    {
        UltraCheckEditor checkEditor = sender as UltraCheckEditor;
        if ( checkEditor.Focused )
        {
            //  TODO: Run query
        }
    }

Children