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
1640
Problem with Lost Focus event
posted

When the user adds a blank row in a grid but then switches to another control, I want to automatcally delete the blank row.  So I have added a lost focus event to perform the delete, and the logic works fine.

The problem is that the lost focus event fires even when focus is still in the grid.  If the user tries to enter data in the newly added grid row, the lost focus event fires and the event logic removes the row.

How do I fix this so that the lost focus is fired only when the grid truly loses focus, or add more logic to the event handler to detect that the grid still has the focus?  BTW, the Focused attribute is also useless - it is false when the user

Parents
No Data
Reply
  • 23930
    Offline posted

    Hello Richard,

    Thank you for contacting Infragistics Developer Support.

    What you could do is instead of using the LostFocus event you use the Leave event. It will fire when the UltraGrid is no longer the active control in the form.

    I have attached a sample to demonstrate this approach.

    Please let me know if you have any additional questions.

    WG_RemoveBlankRow.zip
Children