Tab.Visible = false works but individual items will not go invisible .. i.e. TabItem1.Visible - false does not work

Windows 11 , Visual Studio 2019 (using VB.Net)  ,  Syncfusion.EJ.Web, Version=20.2460.0.36.

Cannot make individual TabItem invisible using code-behind e.g.   TabItem1.Visible = false does nothing, the item still appears.

Any ideas would be greatly appreciated.

Thanks, John


1 Reply

SS Sivakumar ShunmugaSundaram Syncfusion Team August 4, 2022 11:49 AM UTC

Hi John,


As per the shared details, we understand that you want to hide the individual TabItem from the ASP.NET Web Form VB Tab control. We have prepared a simple sample of ASP.NET Web Form VB with a Tab control to hide individual TabItem using the HiddenItemIndex property in the Tab control.


We suggest you set the list of TabItem index values in the HiddenItemIndex property to achieve your requirement. We have attached the prepared sample for your reference.


Refer to the below code snippet.

[Default.aspx]

 

    <ej:Tab ID="DishType" runat="server" Width="500px" >

    <Items>

        <ej:TabItem Id="PizzaType" Text="Pizza Menu">

            <ContentSection>

                <p>Pizza cooked to perfection tossed with milk, vegetables, potatoes, poultry, 100% pure mutton, and cheese - and in creating nutritious and tasty meals to maintain good health.</p>

            </ContentSection>

        </ej:TabItem>

        <ej:TabItem Id="sample" Text="sample">

            <ContentSection>

                <p>Pizza cooked to perfection tossed with milk, vegetables, potatoes, poultry, 100% pure mutton, and cheese - and in creating nutritious and tasty meals to maintain good health.</p>

            </ContentSection>

        </ej:TabItem>

        <ej:TabItem Id="default" Text="default">

            <ContentSection>

                <p>The command-line compiler, VBC.EXE, is installed as part of the freeware .NET Framework SDK. Mono also includes a command-line VB.NET compiler. The most recent version is VB 2012, which was released on August 15, 2012.</p>

            </ContentSection>

        </ej:TabItem>

    </Items>

</ej:Tab>


[Default.aspx.vb],

 

Public Class _Default

    Inherits Page

 

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load

 

        Dim AuthorList1 As List(Of Integer) = New List(Of Integer)()

        AuthorList1.Add(1)

        Me.DishType.HiddenItemIndex = AuthorList1

    End Sub

End Class

 


Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/WebApplication11972552607.zip


Please check the attached sample and get back to us if you need any further assistance.


Regards,

Sivakumar S



Loader.
Up arrow icon