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
605
Forms-Control UltraWinGrid in a Microsoft WindowsFormsHost
posted

Hello there

I am using the Forms-Control UltraWinGrid in a Microsoft WindowsFormsHost (this WindowsFormsHost is hosted in a WPF-window-Application. Project has been attached).

I am facing this problem: By clicking out of the Grid (on the same window) after working on a particular row (in edit-mode), the selected row remains on edit-mode and no event is fired (ie. Leave, AfterExitEditMode oder BeforeExitEditMode).

Is there any way to fix this problem in order to have any event fired

Best regards

Kasar.

TestWPF.zip
  • 605
    Offline posted

    Many thanks for your answers.

  • 2005
    Suggested Answer
    Offline posted

    Hi Kasar,

    I am using UltraWinGrid in my WPF applications with WindowsFormsHost. UltraWinGrid works as a charm in my WPF applications. You should try to get rid of your class ucGrid and assign the UltraGrid instance directly to the Child of your WindowsFormsHost instance. You can put all UltraGrid's event handlers inside your MainWindow class. I do not use design view at all.

    Best Regards,
    Shaolin

  • 469350
    Suggested Answer
    Offline posted

    Hi Kasar,

    This makes sense. The concept of Enter and Leave really only apply within the WindowsFormsHost control.

    I'm not an expert on the WindowsFormsHost, but it seems like this is probably not an uncommon problem, so I wonder if the Host control itself has any support for notifiying you when it loses focus. If not, then the only thing you could do is trap for when some other part of your application gains the focus and use that.

    Whatever synch point you use, you can tell the grid to commit the changes (just like it would do when it loses focus in a WinForms application) by calling the grid.UpdateData() method.