Back to Devexpress

How to: Embed a DateControl into a Group

windowsforms-1674-controls-and-libraries-navigation-controls-navigation-bar-examples-layout-how-to-embed-a-datecontrol-into-a-group.md

latest1.3 KB
Original Source

How to: Embed a DateControl into a Group

  • Nov 13, 2018

The following sample code embeds a DateControl into a NavBarControl’s group. To allow control embedding, the NavBarGroup.GroupStyle property is set to ControlContainer. Then, the DateControl is added to the group via the NavBarGroup.ControlContainer property.

The image below shows the result.

csharp
DevExpress.XtraEditors.DateControl dc = new DevExpress.XtraEditors.DateControl();

navBarGroup1.GroupStyle = DevExpress.XtraNavBar.NavBarGroupStyle.ControlContainer;
navBarGroup1.ControlContainer.Controls.Add(dc);                     
navBarGroup1.GroupClientHeight = dc.Height + 3;
navBarControl1.Width = dc.Width + 3;
vb
Dim dc As New DevExpress.XtraEditors.DateControl()

navBarGroup1.GroupStyle = DevExpress.XtraNavBar.NavBarGroupStyle.ControlContainer
navBarGroup1.ControlContainer.Controls.Add(dc)
navBarGroup1.GroupClientHeight = dc.Height + 3
navBarControl1.Width = dc.Width + 3