Hello,
My question is pretty same as the following one:
http://www.telerik.com/community/forums/aspnet-ajax/tabstrip/rad-tab-click-event-not-firing-the-first-time.aspx
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.
Thanks
ASP.NET (HTML)
<
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"
/>
CODE BEHIND (VB.NET)
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
AddTab(
"Corporate"
)
AddTab(
"Personal"
)
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"
RadTabStrip1.Tabs.Add(tab)
End
Sub
Private
Sub
AddPageView(
ByVal
pageViewID
As
String
)
Dim
pageView
As
New
RadPageView()
pageView.ID = pageViewID
RadMultiPage1.PageViews.Add(pageView)
End
Sub
Protected
Sub
TabStrip1_TabClick(
ByVal
sender
As
Object
,
ByVal
e
As
RadTabStripEventArgs)
Handles
RadTabStrip1.TabClick
AddPageView(e.Tab.Value)
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"
e.PageView.Controls.Add(userControl)
End
Sub
End
Class