Hi,
How can I delete a specific item from the collection?
Regards,
Ken
the collectionview is designed to work with a dynamic number of sections/items. You can specify in the OnGetNumberOfItemsInSection how many items there are, your data needs to be provided by a separate list / collection that you manage in your application. If you delete an item from the list and then call TMSFMXNativeUICollectionView1.ReloadData; the item will be removed.
Hi,
I have been working from your example. I've added a button to delete an item (shown below). Deleting an item is fine but deleting a section crashes on the reload.
Any ideas?
Ken
procedure TForm1130.CityTripItemButtonClick(Sender: TObject;
AControl: TTMSFMXNativeUICollectionViewTemplateControl; ASection,
ARow: Integer);
var
Cont:TContinent;
begin
Cont:=FindContinentByID(ASection);
Cont.Cities.Delete(ARow);
if Cont.Cities.Count=0 then
FContinents.Delete(ASection);
CityTrip.ReloadData;
end;