Page 1 of 1

Hide detail table based on master table condition

Posted: Wed Jun 19, 2024 1:42 pm
by philmills

I have a master table with three detail tables.
the master table contains a select field e.g.:
fieldname "selectDetail"

  • table 1 (value '1')
  • table 2 (value '2')
  • table 3 (value '3')
    when expanding the master row to show the detail tables for the record, I would like to only show the detail table which corresponds to the table selected in "selectDetail".

How can I do that?


Re: Hide detail table based on master table condition

Posted: Wed Jun 19, 2024 7:17 pm
by mobhar

That's very easy.

Let's say from demo2024 project, you want to hide orderdetails table if the OrderID field in master record is equal to 11078, then simplly put this following code in ListOptions_Rendering server event that belongs to the List Page of your orders table:

if (!empty($this->OrderID->CurrentValue) && $this->OrderID->CurrentValue == "11078")
    $this->DetailPages->Items["orderdetails"]->Visible = false;
else
   $this->DetailPages->Items["orderdetails"]->Visible = true;