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

TcxCustomHeader.OnSectionDrag Event

In This Article

Occurs when a user drags a section.

#Declaration

Delphi
property OnSectionDrag: TcxSectionDragEvent read; write;

#Remarks

The OnSectionDrag event occurs when the user drags a section of the cxHeader control.

Parameter Meaning
Sender A TcxHeader object that fired the event.
FromSection A header control section involved in the drag-and-drop operation.
ToSection A header control section representing the destination point of the drag-and-drop operation.
AllowDrag True, if dragging is allowed; False, if dragging is disabled. This parameter can be used to restrict drag-and-drop operations (see the example below).

If you want to react after the drag-and-drop operation was successfully completed, handle the OnSectionEndDrag event.

The following code shows an OnSectionDrag event handler preventing drag-and-drop when the destination is the header control section with an ID property value of 3:

Delphi
procedure TForm1.cxHeader1SectionDrag(Sender: TObject; FromSection,
  ToSection: TcxHeaderSection; var AllowDrag: Boolean);
begin
  AllowDrag := ToSection.ID <> 3;
end;
See Also