TcxCustomListView.OnChanging Event
Occurs before the item in the list view is about to be changed.
Declaration
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:
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