Hi
When the TUITableView.Options.Editions.CellEdit = true and TUITableView.Options.Editions.EditAll = true, all the rows shows the (-) on the left hand side.
How can i set a particular row to show the (-) icon only so that the user can delete that row.
Please advise
thanks
chris
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
-EditingAccesoryType: Which controls if the accesory (Right side indicator) is shown.
-EditingStyle: Wich controls what is shown in Edit mode on the left side of the item.
The second one is what you are looking for. Just put that property to "tvesNone" for each item except for the item you want the (-) button appears.
Hope it helps
Greetings
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
UITableView.Options.Edition.CellEdit := true;
UITableView.Options.Edition.EditAll := true;
for each item in UITableView do begin
if item <> delete_item
item.EditingStyle := tvesNone
end;
please advise
thanks
chris
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Diego
When the delete button appears and the user pressed the delete button, the OnItemDelete event will be triggered.
So, in this event, it will delete the record in the database. If the deletion of record in the database is unsuccessful, how can i restore the item back to the table again? or how can i don't allow the table to remove that item?
please advise
thanks
chris
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi
When the TUITableView.Options.Editions.CellEdit = true and TUITableView.Options.Editions.EditAll = true, all the rows shows the (-) on the left hand side.
How can i set a particular row to show the (-) icon only so that the user can delete that row.
Please advise
thanks
chris
Hi Chris:
Each item in a TUITableView has two properties:
-EditingAccesoryType: Which controls if the accesory (Right side indicator) is shown.
-EditingStyle: Wich controls what is shown in Edit mode on the left side of the item.
The second one is what you are looking for. Just put that property to "tvesNone" for each item except for the item you want the (-) button appears.
Hope it helps
Greetings
Thanks diego.
Do you mean
UITableView.Options.Edition.CellEdit := true;
UITableView.Options.Edition.EditAll := true;
for each item in UITableView do begin
if item <> delete_item
item.EditingStyle := tvesNone
end;
please advise
thanks
chris
Hi Chris:
I suggest you set the property Item.EditingStyle to tvesNone during items creation, or, at least, before you start the edition with the commands:
UITableView.Options.Edition.CellEdit := true;
UITableView.Options.Edition.EditAll := true;
Greetings
Thanks diego.
I will try it out.
Thanks
chris
Hi Diego
When the delete button appears and the user pressed the delete button, the OnItemDelete event will be triggered.
So, in this event, it will delete the record in the database. If the deletion of record in the database is unsuccessful, how can i restore the item back to the table again? or how can i don't allow the table to remove that item?
please advise
thanks
chris