i find the solution…
the solution was use the Post-Prosessing event, whit some custom code that delete the warehouse when it has no active bins:
bool tieneAlgoActivo = false;
List<int> aEliminar = new List<int>();
for (int index = result.PartPlantWhseSearch.Count-1; index >= 0; index--)
{
Erp.Tablesets.PartPlantWhseSearchRow whse = result.PartPlantWhseSearch[index];
tieneAlgoActivo = false;
List<Erp.Tables.WhseBin> Whsebins = (from Whse_Bin in Db.WhseBin where (Whse_Bin.WarehouseCode == whse.WarehouseCode) select Whse_Bin).ToList();
foreach (Erp.Tables.WhseBin whseBin in Whsebins)
{
if (!whseBin.InActive)
{
tieneAlgoActivo = true;
}
}
if (!tieneAlgoActivo)
{
aEliminar.Add(index);
}
}
foreach (int index in aEliminar)
{
result.PartPlantWhseSearch.RemoveAt(index);
}