Page 1 of 1

hide extended search field from a user level

Posted: Tue Apr 09, 2024 6:25 am
by vintoICT

I have some search fileds but i don't want a user level to see the field in search area. but other user levels can . and the prevented user level can see the remaining search fields eaxcept the particular one i intend to hide


Re: hide extended search field from a user level

Posted: Tue Apr 09, 2024 9:54 am
by mobhar

You may simply use Page_Load server event that belongs to the List Page, for example:

if (CurrentUserLevel() == 1) {
    $this->FieldA->Visible = false;
    $this->FieldB->Visible = false;
}

This will hide the field from Extended Search. However, it will also hide the field/column from the Table in the List Page. If you don't want to hide it also from the Table, then you need to put the following code also in Page_DataRendering server event of the List Page:

if (CurrentUserLevel() == 1) {
    $this->FieldA->Visible = true;
    $this->FieldB->Visible = true;
}