Hi Folks
I need to be able to hide a tab based on server-side logic (on the PageLoad).
Some thing like:
Dim usr As New SecurityGuard.SecurityCheck(UserID, CInt(Context.Session("UserSiteID")), "CM", FormId, Session.SessionID.ToString(), Application.Item("Conn").ToString) Me.UserRoles = usr.UserRole If usr.UserInAnyOf("P0", "P1", "P2", "P3", "P4") Then ' they are a student, hide tab.index=2
Dim control As WebTab = Me.tabAssessments ' as a starter, just try to disable it.... control.Tabs.Item(2).ViewStateMode = UI.ViewStateMode.Disabled
' stumped and don't see anything usable in either your docs or on this forum
End If
:
tried this as well...
Me.tabAssessments.Tabs.Item(2).VisibleIndex = 0
rob
Me.tabAssessments.Tabs.Item(2).Enabled=False
does disable the tab (which I could live with)
However, the result of this is such that tab2 is disabled, but then moved to index 0 (tab 0)?
Please advise.
hi
can you supply real code, versus links? (I don't care if it's VB or C#)
I tried fiddling with the ContentTabItem, but could NOT get ANY of it to work (not the various lines commented out in my source):
If usr.UserInAnyOf("P0", "P1", "P2", "P3", "P4") Then 'Me.tabAssessments.Tabs.FindTabFromKey("Summaries") 'Dim control As WebTab = Me.tabAssessments ' DirectCast(Me.tabAssessments.Tabs.FindTabFromKey("Summaries"), WebTab) 'control.Tabs.Item(2).ViewStateMode = UI.ViewStateMode.Disabled 'Me.tabAssessments.Tabs.Item(2).VisibleIndex = 0 Me.tabAssessments.Tabs.Item(2).Enabled = False 'Dim control As WebTab = Me.tabAssessments 'Me.tabAssessments.Tabs.FindTabFromKey("Summaries").Visible = False 'Dim webtab As ContentTabItem = Me.tabAssessments.Tabs(2) 'webtab = Me.tabAssessments.Tabs.FindTabFromKey("Summaries") End If
I'm able to set it manually now? (this was blowing up the other day with it being READ ONLY?)
Me.tabAssessments.Tabs.Item(2).Hidden = True
But, for good programming sake, I'd really appreciate an example using the approach where I'm finding the tab versus hard-wiring in an index:
.Tabs.FindTabFromKey("Summaries")
thanks
Hello Rob,
Thank you for the update.
I am using the latest service release of v11.1 (11.1.20111.2064)
Using the below code snippet I am not able to reproduce the issue
<ig:WebScriptManager ID="WebScriptManager1" runat="server">
</ig:WebScriptManager>
<ig:WebTab ID="WebTab1" runat="server" Height="200px" Width="300px">
<Tabs>
<ig:ContentTabItem runat="server" Text="Tab 1" Key="First">
<Template>
<asp:Label ID="Label1" runat="server" Text="Tab 1"></asp:Label>
</Template>
</ig:ContentTabItem>
<ig:ContentTabItem runat="server" Text="Tab 2" Key="Second">
<asp:Label ID="Label2" runat="server" Text="Tab 2"></asp:Label>
<ig:ContentTabItem runat="server" Text="Tab 3" Key="Third">
<asp:Label ID="Label3" runat="server" Text="Tab 3"></asp:Label>
</Tabs>
</ig:WebTab>
protected void Page_Load(object sender, EventArgs e)
{
ContentTabItem item = WebTab1.Tabs.FindTabFromKey("Second");
item.Hidden = true;
}
Can you please provide me with an isolated sample reproducing the issue?
Hope hearing from you.
ok, this was my issue.there MUST be a "key" attribute assigned in the webtab of the .aspx.i was thinking that the "key" was the "text" (label attribute) of the tab item (since I didn't see a thing in your doc links that gave me any clue of this feature/attribute/property.
It would be really nice, if the group that defines these controls, if they would stick with a STANDARD convention, which seems to be there with 99% of the other controls you folks have (and use ".visible" -> Me.tabAssessments.Tabs.Item(2).visible= False versus "hidden")
Thank you for taking the time to point this out :)
Rob
I am glad that you have been able to resolve the issue.
Please let me know if you need further assistance