I was trying to hide a tab that is unused. And I was doing everything that is explained by this thread Hiding a tab from the user interface dynamically.
Based on that thread, I use method 2 because there are more than 1 condition that affect the visibility of the TabItem. Here is the code that I write
MaterialDetail.Cache.AllowSelect = row.ItemNature == "TXL";
TextileDetail.Cache.AllowSelect = row.ItemNature == "GRM";
MaterialsSizings.Cache.AllowSelect = row.ItemNature == "TXL" && row.TextileItemType == "SIZ";
MaterialsWarpings.Cache.AllowSelect = row.ItemNature == "TXL" && row.TextileItemType == "WAR";
MaterialsWeavings.Cache.AllowSelect = row.ItemNature == "TXL" && row.TextileItemType == "WEA";
And I also ensure that the RepainOnDemand is set to false
<px:PXTabItem RepaintOnDemand="false" Text="Material Garment Details">
The problem that I found next is, the TabItem is still there, but there is nothing inside it. Like shown in this picture.
I was wandering if I missed something. Thank you in advance
EDIT
This is what is looks like when the grid is visible
The data view for Material Garment Details is MaterialDetail. And the AllowSelect is in RowSelected event.