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

Perform TabClick event

1 Answer 57 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
El asked on 15 Nov 2010, 01:22 PM


My question is pretty same as the following one:

I followed the demo "TabStrip / Load on Demand RadPageView" and i can say that most of the code is missing so i had to combine the code from the other demoS in order to achieve what i want (please refer the code below).

However the thing is that i can't make it loads the very first pageview when tabs are created. After you click another tabpage it works as expected.

It is something similar to windows button control which has a "PerformClick" event. 



<telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0"  CssClass="multiPage" />
<telerik:RadTabStrip OnClientTabSelecting="onTabSelecting" ID="RadTabStrip1" SelectedIndex="0" CssClass="tabStrip" runat="server" MultiPageID="RadMultiPage1" Skin="Office2007" Orientation="HorizontalBottom" />


Imports Telerik.Web.UI
Public Class _Default
    Inherits System.Web.UI.Page
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not Page.IsPostBack Then
        End If
    End Sub
    Private Sub AddTab(ByVal tabName As String)
        Dim tab As New RadTab
        tab.Text = tabName
        tab.Value = tabName & ".ascx"
        tab.PageViewID = tabName.Replace(" "c, "") & ".ascx"
    End Sub
    Private Sub AddPageView(ByVal pageViewID As String)
        Dim pageView As New RadPageView()
        pageView.ID = pageViewID
    End Sub
    Protected Sub TabStrip1_TabClick(ByVal sender As Object, ByVal e As RadTabStripEventArgs) Handles RadTabStrip1.TabClick
        e.Tab.PageView.Selected = True
    End Sub
    Private Sub MultiPage1_PageViewCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadMultiPageEventArgs) Handles RadMultiPage1.PageViewCreated
        Dim userControlName As String = e.PageView.ID
        Dim userControl As Control = Page.LoadControl(userControlName)
        userControl.ID = e.PageView.ID + "_userControl"
    End Sub
End Class

1 Answer, 1 is accepted

Sort by
Top achievements
Rank 1
answered on 16 Nov 2010, 04:51 PM
I have it resolved in the meantime. I just had to manually add the pageview after i initialize the new tab page.
' initialize the needed tab pages
AddTab("Personal Info")

Later if you click this tab it does nothing because user control is already loaded into the pageview.

Thanks for reading it.
Asked by
Top achievements
Rank 1
Answers by
Top achievements
Rank 1
Share this question