Skip to main content

ASPxClientScheduler.SetGroupType(value) Method

Client-side scripting method which raises the callback command to set the ASPxScheduler.GroupType.

Declaration

SetGroupType(
    value: ASPxSchedulerGroupType
): void

Parameters

Name Type Description
value ASPxSchedulerGroupType

An ASPxSchedulerGroupType enumeration value, which specifies how appointments are grouped.

Example

In this example, additional items in the “Default (View)” menu are used to switch the “Group Type” parameter. The ASPxClientScheduler.MenuItemClicked event is handled to execute the ASPxClientScheduler.SetGroupType method to change the current grouping type.

        protected void ASPxScheduler1_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e) {
            // An additional item is added into the "Appointment" menu to switch the "Completed" state of a current appointment
            // A currently selected appointment is updated on a separate callback request which is invoked in the client-side MenuItemClicked event handler
            if(e.Menu.MenuId == DevExpress.XtraScheduler.SchedulerMenuItemId.AppointmentMenu) {
                e.Menu.ClientSideEvents.PopUp = "OnClientPopupMenuShowing";
                DevExpress.Web.MenuItem newItem = new DevExpress.Web.MenuItem();
                newItem.Name = "ChangeCompletedStatus";
                newItem.Text = "Mark as Completed";
                e.Menu.Items.Add(newItem);
            }

            // Additional items are added into the "Default (View)" metnu to switch the "Group Type" parameter
            // A current groupping type is changed by executing the client-side SetGroupType method in the MenuItemClicked event handler
            if(e.Menu.MenuId == DevExpress.XtraScheduler.SchedulerMenuItemId.DefaultMenu) {
                DevExpress.Web.MenuItem newSubItem = new DevExpress.Web.MenuItem();
                newSubItem.Name = "ChangeGroupType";
                newSubItem.Text = "Change Group Type";


                DevExpress.Web.MenuItem subMenuItemDate = new DevExpress.Web.MenuItem();
                subMenuItemDate.Name = "GroupByDate";
                subMenuItemDate.GroupName = "ChangeGroupType";
                subMenuItemDate.Text = "Group By Date";
                subMenuItemDate.Checked = ASPxScheduler1.GroupType == SchedulerGroupType.Date;
                newSubItem.Items.Add(subMenuItemDate);

                DevExpress.Web.MenuItem subMenuItemResource = new DevExpress.Web.MenuItem();
                subMenuItemResource.Name = "GroupByResource";
                subMenuItemResource.GroupName = "ChangeGroupType";
                subMenuItemResource.Text = "Group By Resource";
                subMenuItemResource.Checked = ASPxScheduler1.GroupType == SchedulerGroupType.Resource;
                newSubItem.Items.Add(subMenuItemResource);

                DevExpress.Web.MenuItem subMenuItemNone = new DevExpress.Web.MenuItem();
                subMenuItemNone.Name = "GroupByNone";
                subMenuItemNone.GroupName = "ChangeGroupType";
                subMenuItemNone.Text = "Group By None";
                subMenuItemNone.Checked = ASPxScheduler1.GroupType == SchedulerGroupType.None;
                newSubItem.Items.Add(subMenuItemNone);

                e.Menu.Items.Add(newSubItem);
            }
        }
See Also