Hi,
is there a way to detect that the detailview is visible (together with the back button) and then to programmatically call the back button so that the back button disappears and the calling main view is visible?
Kind regards
gernot
Hi,
Perfect - Thanks
Hi Pieter,
after further tests with
if tvMediaDetail.isDetailMode then
begin
tvMediaDetail.SelectedItem.HideDetailView;
end;
I always get an access violation after the detailview is hidden. Is this a bug or is there an issue with my call to HideDetailView?
Kind regards
Gernot
Can you verify if SelectedItem is assigned?
Yes. I modified the code as follows:
if tvMediaDetail.isDetailMode then
begin
test := tvMediaDetail.SelectedItem;
if Assigned(test) then
tvMediaDetail.SelectedItem.HideDetailView;
end;
tvMediaDetail.Categories.Clear;
tvMediaDetail.Items.Clear;
The access violation occurs because of the following two lines as I need to clear the tableview afterwards. I put those lines now in a BeginUpdate..EndUpdate and this seems to solve the problem
Thanks
gernot
Yes, for runtime updates, always use beginupdate/endupdate: