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 Tcx |
From |
A header control section involved in the drag-and-drop operation. |
To |
A header control section representing the destination point of the drag-and-drop operation. |
Allow |
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