Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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;