This is a migrated thread and some comments may be shown as answers.

programaticly enabling tabs

1 Answer 87 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Dave
Top achievements
Rank 1
Dave asked on 19 Jan 2012, 07:19 PM
Hi,

I have a sub routine in my code behind  (vb) which fires when an event occurs.  What I want to do is selectively enable and disable 4 tabs in the tab strip and set focus to one tab.

here is my code
Private Sub LookupTag(tag As String)
 
    Dim c1 As New RadTabStrip
    Select Case tag
        Case "11000ed97c"           'credit card
            'RadTabStrip1.Tabs(1).Focus()
            c1 = RadTabStrip1.FindControl("RadTabStrip1")
            c1.Tabs(0).Enabled = True
            c1.Tabs(1).Enabled = False
            c1.Tabs(2).Enabled = False
            c1.Tabs(3).Enabled = False
        Case "4d004a7d6f"           'watch
            c1 = RadTabStrip1.FindControl("RadTabStrip1")
            c1.Tabs(0).Enabled = False
            c1.Tabs(1).Enabled = True
            c1.Tabs(2).Enabled = False
            c1.Tabs(3).Enabled = False
        Case "0107ee84cd"           'Key Chain
            c1 = RadTabStrip1.FindControl("RadTabStrip1")
            c1.Tabs(0).Enabled = False
            c1.Tabs(1).Enabled = False
            c1.Tabs(2).Enabled = True
            c1.Tabs(3).Enabled = False
        Case "0107ee8a61"           'disk
            c1 = RadTabStrip1.FindControl("RadTabStrip1")
            c1.Tabs(0).Enabled = False
            c1.Tabs(1).Enabled = False
            c1.Tabs(2).Enabled = False
            c1.Tabs(3).Enabled = True
    End Select
and here is the asp for the tabstrip
<telerik:RadTabStrip ID="RadTabStrip1" runat="server" Skin="Black" MultiPageID="RadMultiPage1"
    SelectedIndex="0" CssClass="tabStrip" AutoPostBack="True">
    <Tabs>
        <telerik:RadTab Text="Ops">
        </telerik:RadTab>
        <telerik:RadTab Text="Management">
        </telerik:RadTab>
        <telerik:RadTab Text="IT">
        </telerik:RadTab>
        <telerik:RadTab Text="Maintenance">
        </telerik:RadTab>
    </Tabs>
</telerik:RadTabStrip>

Can someone give me a hand?

Thanks in advance,

Dave

1 Answer, 1 is accepted

Sort by
0
Kate
Telerik team
answered on 20 Jan 2012, 03:00 PM
Hello Dave,

If you need to have a particular tab enabled and selected at the same time you will need to set both Enable and Selected properties of the tabs to true. Please take a look at the definition of your modified handler below for further reference:
Private Sub LookupTag(ByVal tag As String)
 
        Dim c1 As New RadTabStrip
        Select Case tag
            Case "11000ed97c"           'credit card
                'RadTabStrip1.Tabs(1).Focus()
                c1 = RadTabStrip1
                c1.Tabs(0).Enabled = True
                c1.Tabs(1).Enabled = False
                c1.Tabs(2).Enabled = False
                c1.Tabs(3).Enabled = False
            Case "4d004a7d6f"           'watch
                c1 = RadTabStrip1
                c1.Tabs(0).Enabled = False
                c1.Tabs(1).Enabled = True
                c1.Tabs(1).Selected = True
                c1.Tabs(2).Enabled = False
                c1.Tabs(3).Enabled = False
            Case "0107ee84cd"           'Key Chain
                c1 = RadTabStrip1
                c1.Tabs(0).Enabled = False
                c1.Tabs(1).Enabled = False
                c1.Tabs(2).Enabled = True
                       c1.Tabs(2).Selected = True
                c1.Tabs(3).Enabled = False
            Case "0107ee8a61"           'disk
                c1 = RadTabStrip1
                c1.Tabs(0).Enabled = False
                c1.Tabs(1).Enabled = False
                c1.Tabs(2).Enabled = False
                c1.Tabs(3).Enabled = True
                       c1.Tabs(3).Selected = True
        End Select
 
    End Sub

Kind regards,
Kate
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
TabStrip
Asked by
Dave
Top achievements
Rank 1
Answers by
Kate
Telerik team
Share this question
or