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

TcxCustomListView.OnChanging Event

In This Article

Occurs before the item in the list view is about to be changed.

#Declaration

Delphi
property OnChanging: TLVChangingEvent read; write;

#Remarks

Handle the OnChanging event if you wish to implement some specific action before the item is changed. By applying an appropriate handler if may, for example, prevent some particular items from changing but allow others to be changed.

Sender specifies the TcxCustomInnerListView.

Item represents the item to be changed.

AllowChange specifies whether the operation can be performed. Set AllowChange to True, to allow the item modification.

The following code demonstrates the OnChanging event handler. This handler checks whether the item’s caption is edited within a list view and restricts editing if the index of the edited item is 2:

Delphi
procedure TForm1.cxListView1Changing(Sender: TObject; Item: TListItem; Change: TItemChange; var AllowChange: Boolean);
begin
  if cxListView1.IsEditing then
    if (Item.Index = 2) and (Change = ctText) then AllowChange := False;
end;
See Also