Skip to main content

How to: Embed a DateControl into a Group

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.

embedding_datecontrol_into_a_group

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;