If you want to obviously hide all the Labels caption for Checkboxes control in Grid-Edit page, then you may simply use Lookup_Selecting server event.For example, the field is Custodian_id and the lookup table name is lookup, it has two fields: Code and Description, which the link field is Code, and the display field is Description, then you may simply use this code:
if ($fld->Name == "Custodian_id" && $this->isGridEdit())
$fld->Lookup->setOptions(ExecuteRows("SELECT Code, ' ' AS Description FROM lookup")); // adjust the lookup table name to yours
if ($fld->Name == "Custodian_id"){
AddFilter($filter, "id = '$vintocustodianid'");
$fld->Lookup->setOptions(ExecuteRows("SELECT id, ' ' AS Lastname FROM custodianstbl WHERE id = '$vintocustodianid'"));
}
Although your code is working fine in Grid-Edit mode, you should add condition to check whether the current page is in Grid-Edit mode, just like you mentioned in your first post above.This code:
if ($fld->Name == “Custodian_id”){should be:
if ($fld->Name == “Custodian_id” && $this->isGridEdit()) {If you did not add that condition, then you will see in the List page (not Grid-Edit mode), the value in that Custodian_id column will be blank.