Problem with region that hosts a windows forms grid control

Add-in Express™ Support Service
That's what is more important than anything else

Problem with region that hosts a windows forms grid control
When hosting a grid control inside a region the main Outlook window is not redrawing properly 
mitchell balsam




Posts: 8
Joined: 2017-01-27
Hello, i have found a problem which i'm not sure how to handle but seems to be related to hosting windows forms inside an add-in express region.

I have a region that shows on top of the reading pane in Outlook 'ADXOlExplorerLayout.TopSubpane'
My region contains a windows forms grid (Grid.NET) from https://10tec.com which shows a custom list of messages

When a message is clicked i get the message from the mail store and run this code

MailItem item = store.Session.GetItemFromID(messageData.OutlookEntryId);
Explorer activeExplorer = item.Application.ActiveExplorer();
activeExplorer.ClearSelection();
activeExplorer.AddToSelection(item);


This works, i can see the message displayed on the reading pane but eventually i'm seeing a problem where the reading pane or other parts of the Outlook window are not redrawn correctly

What appears to happen is that the windows messages are somehow lost or redirected by the grid control that is hosted inside the region, if i minimize and then restore the Outlook window i can see it redraw itself

I can also see it redraw if i resize the Outlook window.

Until i do one of the things above, the window remains in an invalid state, showing old content or simply showing white rectangles instead of the controls on that location.

So my theory is that the windows form grid is somehow interfering with the message loop and hijacking messages that the reading pane or the Outlook main window should have received.

In your experience, have you seen something like this before?

Is there anything special or specific i need to do in order to host windows forms controls inside an add-in express region?

This is how i'm setting up my region, which contains the grid.net control:

MessageListViewRegion = new ADXOlFormsCollectionItem();
MessageListViewRegion.ExplorerLayout = ADXOlExplorerLayout.TopSubpane;
MessageListViewRegion.ExplorerItemTypes = ADXOlExplorerItemTypes.olMailItem;
MessageListViewRegion.ExplorerMessageClass = "IPM.Note";
MessageListViewRegion.InspectorLayout = ADXOlInspectorLayout.TopSubpane;
MessageListViewRegion.InspectorItemTypes = ADXOlInspectorItemTypes.olMail;
MessageListViewRegion.InspectorMessageClass = "IPM.Note";
MessageListViewRegion.InspectorMode = ADXOlInspectorMode.Read;
MessageListViewRegion.DefaultRegionState = ADXRegionState.Hidden;
MessageListViewRegion.AlwaysShowHeader = false;
MessageListViewRegion.Splitter = ADXOlSplitterBehavior.None;
MessageListViewRegion.CloseButton = false;
MessageListViewRegion.UseOfficeThemeForBackground = true;
MessageListViewRegion.FormClassName = typeof(VenueMessageGrid).FullName;
this.FormsManager.Items.Add(MessageListViewRegion);
Posted 29 Nov, 2017 16:40:28 Top
Andrei Smolin


Add-in Express team


Posts: 15212
Joined: 2006-05-11
Hello Mitchell,

Could you please check if the issue is reproducible in a simple project with no Grid.NET controls? If the issue is reproducible, please send us this project to the support email address; find it in {Add-in Express installation folder}\readme.txt; please make sure your email contains a link to this topic.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 30 Nov, 2017 06:06:42 Top
mitchell balsam




Posts: 8
Joined: 2017-01-27
I will ask my the developer to send you the working sample. This is really our schedule, please turn around quickly if possible.

Many thanks..
Posted 30 Nov, 2017 08:38:38 Top
Andrei Smolin


Add-in Express team


Posts: 15212
Joined: 2006-05-11
Mitchell,

Please make it as simple as possible; dealing with a complex project is a nightmare.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 30 Nov, 2017 08:43:00 Top
mitchell balsam




Posts: 8
Joined: 2017-01-27
In writing the sample, we identified the grid control was causing the problem. It's fixed now.. Thanks
Posted 30 Nov, 2017 15:53:33 Top
Andrei Smolin


Add-in Express team


Posts: 15212
Joined: 2006-05-11
Thank you for letting us know!

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 01 Dec, 2017 04:19:23 Top