New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

RadTabStrip Object

The table below lists the most important methods of the client-side RadTabStrip object. Many significant methods for performing common tasks such as adding, inserting and removing tabs are actually performed using the RadTabCollection object.

NameParametersReturn TypeDescription
trackChangesnonenoneBegins tracking changes to the tabs. Only changes to the tabs that occur between a call to trackChanges and commitChanges persist after a postback. See Example 1.
commitChangesnonenoneEnds tracking changes to the tabs. Only changes to the tabs that occur between a call to trackChanges and commitChanges persist after a postback. See Example 1.
disablenonenoneDisables all tabs in the tab strip. Clicking on any tab has no effect, child tabs cannot be opened. See Example 2.
enablenonenoneEnables all tabs in the tab strip. See Example 3.
set_enabledboolnoneEnables or disables all tabs in the tab strip. See Example 2 and Example 3.
get_enablednonebooleanTrue if the tab strip is enabled. To enable a tab strip, use the enable() or set_enabled(true) methods.
findTabByValuestringRadTabReturns the first RadTab object whose Value property is equal to the passed parameter.
findTabByTextstringRadTabReturns the first RadTab object whose Text property is equal to the passed parameter.
findTabByUrlstringRadTabReturns the first RadTab object whose NavigateUrl property is equal to the passed parameter.
findTabByAbsoluteUrlstringRadTabReturns the first RadTab object whose NavigateUrl property is equal to the passed parameter. Note that the parameter should end with '/' like: 'https://www.telerik.com/';
findTabByAttributestring attributeName, string value)RadTabReturns the first RadTab object with a custom attribute of the specified name that has the specified value.
repaintnonenoneRedraws the RadTabStrip control
get_tabsnoneRadTabCollectionReturns the collection of root level tabs. See Example 1 and Example 4.
get_allTabsnoneArrayGets a linear collection of all tabs. This includes all root and child tabs in the tab strip. See Example 5.
get_selectedTabnoneRadTabReturns the root level selected tab. Null if no root tab has been selected.
get_multiPagenoneRadMultiPageReturns the associated RadMultiPage, if any.
get_multiPageIDnoneStringReturns the value of MultiPageID property, if any.
set_multiPageIDStringnoneReturns true if the tab is visible or false otherwise.
get_attributesnoneCollectionReturns the collection of custom attributes for the tab strip.
get_elementnoneHTML ElementGets the DOM element for the tab strip. See Example 6 and Example 7.
get_childListElementnoneHTML ElementGets the DOM element for the list of tabs in the tab strip.
get_validationGroupnoneStringGets the name of the validation group to be used for the integrated validation controls.
set_validationGroupStringnoneSets the name of the validation group to be used for the integrated validation controls.
add_<EventName>(mixed eventHandler)noneAttaches an eventHandler to the event with the name . Note that client-side event names differ from their server-side counterparts. For more information, see Client-Side Events. See Example 8.
remove_<EventName>(mixed eventHandler)BooleanDetaches an eventHandler from the event with the name .Returns "True" if the eventHandler is found and detached, false otherwise.Note that client-side event names differ from their server-side counterparts. For more information, see Client-Side Events. See Example 9.

Client side changes are available on the server side after postback. You can use the ClientChanges property to access them.

Note that attached or removed events from the RadTabStrip object will not be persisted after postback even if implemented between trackChanges() and commitChanges() calls. Enabling an initially disabled RadTabStrip will also not persist.

Example 1. Adding tab using trackChanges() and commitChanges()

JavaScript
function addNewTab() {  
	var tabStrip = $find("<%= RadTabStrip1.ClientID %>");
	var tab = new Telerik.Web.UI.RadTab();
	tab.set_text("New Tab");
	tabStrip.trackChanges();
	tabStrip.get_tabs().add(tab);
	tabStrip.commitChanges();       
} 	

Example 2. Disable RadTabStrip

JavaScript
function disableTabStrip() {
	var tabStrip = $find( "<%= RadTabStrip1.ClientID %>");
	tabStrip.disable();
	//or tabStrip.set_enabled(false);
} 				

Example 3. Enable RadTabStrip

JavaScript
function enableTabStrip() {
	var tabStrip = $find( "<%= RadTabStrip1.ClientID %>");
	tabsStrip.enable();
	//or tabStrip.set_enabled(true);
} 			

Example 4. Get the text of all root tabs of a RadTabStrip

JavaScript
function alertRootTabsText() {
	var tabStrip = $find( "<%= RadTabStrip1.ClientID %>");
	var tabs = tabStrip.get_tabs();
	for (var i=0; i < tabs.get_count(); i++) {
	   alert(tabs.getTab(i).get_text());
	}
} 				

Example 5. Get the text of all tabs in a RadTabStrip

JavaScript
function alertTabsText() {
	var tabStrip = $find( "<%=RadTabStrip1.ClientID %>");
	for (var i=0; i< tabStrip.get_allTabs().length; i++) {
	   alert(tabStrip.get_allTabs()[i].get_text());
	}
} 			

Example 6. Hide the RadTabStrip

JavaScript
// note this change does not persist after a postback
function hideTabStrip() {
	var tabStrip = $find( "<%= RadTabStrip1.ClientID %>");
	tabStrip.get_element().style.display = "none" ;
}

Example 7. Show the RadTabStrip

JavaScript
// note this change does not persist after a postback
function showTabStrip() {
	var tabStrip = $find("<%= RadTabStrip1.ClientID %>");
	tabStrip.get_element().style.display = "" ;
} 				

Example 8. Attach client-side event handler to the RadTabStrip

JavaScript
function OnClientTabSelectingHandler(sender, args) {
	alert(args.get_tab().get_text() );
}
function AttachHandler() {
	var tabStrip  = $find( "<%=RadTabStrip1.ClientID %>");
	tabStrip.add_tabSelecting( OnClientTabSelectingHandler);
} 			

Example 9. Remove client-side event handler from the RadTabStrip

JavaScript
function OnClientTabSelectingHandler(sender, args) {
	alert(args.get_tab().get_text() );
}
function DetachHandler() {
	var tabStrip = $find("<%=RadTabStrip1.ClientID %>");
	tabStrip.remove_tabSelecting(OnClientTabSelectingHandler);
} 			

See Also

In this article
See Also
Not finding the help you need?
Contact Support