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

Conditional loading of tabs

1 Answer 138 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Jaimin
Top achievements
Rank 1
Jaimin asked on 17 Feb 2009, 08:55 AM
Hi,

I want to achieve below functionality from both client side and server side.

I have registered TabClick event so that I can reload the data shown in a tab. But when I click on first tab then I don't want a post back on server i.e. that tab only contains static data for which I'll not like to have a server hit. I tired implementing OnClientTabSelecting event where in I wrote the code:

var

selectedTabIndex = eventArgs.get_tab().get_index();

 

alert(

"tab index : " + selectedTabIndex);

 

 

if(selectedTabIndex == 0)

 

{

eventArgs.get_tab().set_selected = true;

 

 

eventArgs.get_tab().set_visible = true;

eventArgs.set_cancel(

true);

 

 

 

 

}//if

 


But the tab does not gets selected, the previous selected tab remains selected. Can someone help me out? If I remove the code then post back occurs which is not the required functionality.

Thanks and Regards,
Jaimin

1 Answer, 1 is accepted

Sort by
0
Paul
Telerik team
answered on 17 Feb 2009, 09:09 AM
Hello Jaimin,

You can easily achieve your goal by setting the PostBack property of the needed tab to false.

<telerik:RadTabStrip ID="RadTabStrip1" runat="server" OnTabClick="RadTabStrip1_TabClick"
        <Tabs> 
        <telerik:RadTab runat="server" Text="Root RadTab1" PostBack="false"
        </telerik:RadTab> 
        <telerik:RadTab runat="server" Text="Root RadTab2"
        </telerik:RadTab> 
        <telerik:RadTab runat="server" Text="Root RadTab3"
        </telerik:RadTab> 
    </Tabs> 
</telerik:RadTabStrip> 


Sincerely yours,
Paul
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
TabStrip
Asked by
Jaimin
Top achievements
Rank 1
Answers by
Paul
Telerik team
Share this question
or