This is a migrated thread and some comments may be shown as answers.

Drawing problem when Context menu gets opened

2 Answers 156 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Tommy
Top achievements
Rank 1
Tommy asked on 27 Aug 2008, 07:42 AM
Hi,

I've got on last problem I need to solve before I'm happy to be finished with a long journey.

I had to integrade the Grid Control into a large C++ solution, therefore I had to create a MFC custom control with CLR activated and loaded the RadGridView in this custom control. Then, the custom control can be placed on the MFC dialogs.

Now to my problem: When I right click on such integrated RadGrid, the context meny opens but in the backgroud the grid vanishes. When I then move the mouse over the grid, it gets becomes visible again.

Everything is working fine with RadGrids that are called from within the C++ app but open in their own WinForm Dialog. One little thing which appers with every RadGrid is, when I open the context menu by accident or just want it to close again, I need to choose one option. When I right click again it just opens anoder context menu and I then have two of them.w

Can the problem be solvend from the .Net side? If yes how? If it is a problem with C++ and MFC does anyone have an Idea there?

2 Answers, 1 is accepted

Sort by
0
Tommy
Top achievements
Rank 1
answered on 27 Aug 2008, 07:46 AM
Sorry, the second little problem is as well only on the RadGrid which is integrated into an MFC dialog.
0
Julian Benkov
Telerik team
answered on 28 Aug 2008, 03:04 PM
Hi Tommy,

Thank you for the interesting question.

When you open a Windows Form from a COM client application, such as a Visual Basic 6.0 application, or an MFC application, the form may behave unexpectedly. For example, when you press the TAB key, the focus does not change from one control to another control. When you press the ENTER key while a command button has focus, the button's Click event is not raised. You may also experience unexpected behavior for keystrokes or mouse activity.

This behavior occurs because the unmanaged application does not implement the message loop support that Windows Forms requires to work correctly. The message loop provided by the COM client application is fundamentally different from the Windows Forms message loop.

An application's message loop is an internal program loop that retrieves messages from a thread's message queue, translates them, and then sends them to the application to be handled. The message loop for a Windows Form does not have the same architecture as message loops that earlier applications, such as Visual Basic 6.0 applications and MFC applications, provide. The window messages that are posted to the message loop may be handled differently than the Windows Form expects. Therefore, unexpected behavior may occur. Some keystroke combinations may not work, some mouse activity may not work, or some events may not be raised as expected. Here you can find full article: http://msdn2.microsoft.com/en-us/library/ms229600(VS.80).aspx



Best wishes,
Julian Benkov
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
GridView
Asked by
Tommy
Top achievements
Rank 1
Answers by
Tommy
Top achievements
Rank 1
Julian Benkov
Telerik team
Share this question
or