Articles in this section
Category / Section

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

2 mins read

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


Conclusion

I hope you enjoyed learning about how to host the GridGroupingControl as MS Outlook 2013 WinForms RibbonControlAdv.

You can refer to our  WinForms RibbonControl feature tour page to know about its other groundbreaking feature representations. You can also explore our WinForms RibbonControl documentation to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied