)
We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to host the GridGroupingControl as MS Outlook 2013 WinForms RibbonControlAdv?

Platform: WinForms |
Control: RibbonControlAdv |
Published Date: May 26, 2015 |
Last Revised Date: January 8, 2020

Host the GridGroupingControl

The UserControl cannot be hosted in the RibbonTabItem, by default. So, the UserControl has to be derived from the RibbonControl. The GridGroupingControl has to be created, derived from the RibbonControl, and then hosted as MS Outlook 2013 Ribbon item. The following code example demonstrates the same.

C#

using Microsoft.Office.Tools.Ribbon;
using Syncfusion.Windows.Forms.Grid.Grouping;
//Creates the custom control to be loaded into the MS RibbonTab.
public partial class RibbonGrid : GridGroupingControl, RibbonControl
{
    public RibbonGrid()
    {
        InitializeComponent();
    }
    public new RibbonComponent Parent
    {
        get { throw new NotImplementedException(); }
    }
    public void PerformDynamicLayout()
    {
        throw new NotImplementedException();
    }
    public OfficeRibbon Ribbon
    {
        get { throw new NotImplementedException(); }
    }
    public Microsoft.Office.Core.IRibbonUI RibbonUI
    {
        get { throw new NotImplementedException(); }
    }
    public string Id
    {
        get { return "SyncfusionGrid1"; }
    }
}
//Creates object for custom control.
internal RibbonGrid grid= new OutlookAddIn1.RibbonGrid();
//Adds the control to the Ribbon Group.
this.group1.Items.Add(this.grid);

VB

'Creates custom control to be loaded into the MS RibbonTab.
Partial Public Class RibbonGrid
    Inherits GridGroupingControl
    Implements RibbonControl
    Public Sub New()
        InitializeComponent()
    End Sub
    Public Shadows ReadOnly Property Parent() As RibbonComponent
        Get
   Throw New NotImplementedException()
        End Get
    End Property
    Public Sub PerformDynamicLayout()
        Throw New NotImplementedException()
    End Sub
    Public ReadOnly Property Ribbon() As OfficeRibbon
        Get
   Throw New NotImplementedException()
        End Get
    End Property
    Public ReadOnly Property RibbonUI() As Microsoft.Office.Core.IRibbonUI
        Get
   Throw New NotImplementedException()
        End Get
    End Property
    Public ReadOnly Property Id() As String
        Get
   Return "SyncfusionGrid1"
        End Get
    End Property
End Class
'Creates object for the custom control.
Dim grid As RibbonGrid = New OutlookAddIn1.RibbonGrid
'Adds the control to the Ribbon Group.
Me.group1.Items.Add(Me.grid)

 

Note:

By using the above code, the Syncfusion WF controls can be loaded into the RibbonTabItem at design time. To integrate custom controls into the RibbonTabItem at runtime, implement the required properties and functions accordingly.

 

Add custom control to MS Ribbontab

Figure 1: Custom control added to MS RibbonTab

Samples:

C#: http://www.syncfusion.com/downloads/support/directtrac/136015/OutlookAddIn-1401489083.zip

VB: http://www.syncfusion.com/downloads/support/directtrac/134053/OutlookAddIn_VB-871346729.zip

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon