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

RadPanelItem Object

The RadPanelItem object is returned by the getItem method of the RadPanelItemCollection object or the "findItemBy..." methods of the RadPanelBar object. It is also exposed by the eventArgs of many client-side events. The following table lists the most important methods:

 

NameParametersReturn TypeDescription
findControlStringObjectReturns the client-side object of the Control with the specified ID nested in the Item's Template. The ID passed as an argument to the function MUST be the ID attribute of the nested Control.
disablenonenoneDisables the item. See Example 1.
enablenonenoneEnables the item if it is disabled.
get_isEnablednoneBooleanReturns true if both the item and the panelbar are enabled. If one of them is disabled, get_isEnabled() will return false.
get_enablednoneBooleanSame as get_isEnabled.
set_enabledBooleannoneSets the enabled state of the item.
focusnonenoneMoves focus to the item. See Example 2.
blurnonenoneRemoves focus from the item. See Example 3.
focusPreviousItemnonenoneMoves focus to the previous item.
focusNextItemnonenoneMoves focus to the next item.
focusFirstChildnonenoneMoves focus to the first child of the item.
focusLastChildnonenoneMoves focus to the last child of the item.
get_focusedItemnoneRadPanelItemGets the focused child item. Null if no child item is focused.
get_focusednoneBooleanReturns a boolean indicating whether the item has focus.
set_focusedBooleannoneSets a boolean indicating whether the item has focus.
get_previousSiblingnoneRadPanelItemReturns the previous sibling or null if this is the first item at its level.
get_nextSiblingnoneRadPanelItemReturns the next sibling or null if this is the last item at its level.
get_itemsnoneRadPanelItemCollectionGets the child items of the current item.
get_expandedItemnoneRadPanelItemReturns the child item that was most recently expanded. Null if no child item is expanded.
get_selectednoneBooleanReturns whether the item is selected.
set_selectedBooleannoneselects or de-selects the item.
selectnonenoneSelects the item.
unSelectnonenoneDe-selects the item.
get_parentnoneRadPanelBaror RadPanelItemReturns an instance of the parent object. If this is a root item, the parent object is RadPanelBar and if this is a child item - a RadPanelItem .
get_panelBarnoneRadPanelBarReturns an instance of the panel bar that contains the item.
get_indexnoneIntegerGets the zero-based index of the item inside its parent items collection.
get_levelnoneIntegerGets the level of the item. Root level items are level 0.
get_attributes(none)CollectionReturns the collection of custom attributes for the item. See Example 4.
expandnonenoneExpands the item and reveals its children if any.
collapsenonenoneCollapses the item if it is expanded.
get_expandedBooleanbooleanGets the expanded/collapsed state of a panel bar item
set_expandedBooleannoneExpands /Collapses the item.
get_visiblenonebooleanReturns true if the items is visible or false if the item is invisible.
set_textstringnoneSets the text of the item.
get_textnonestringReturns the text of the item.
set_valuestringnoneSets the Value property of the item.
get_valuenonestringReturns the Value property of the item.
get_isSeparatornonebooleanReturns true the item is a separator (sever-side property IsSeparator = true)
get_navigateUrlnonestringGets the URL of the Web page the panel item launches.
set_navigateUrlstringnoneSets the navigateURL property of the item. This is the URL of the Web page the item launches. The navigateUrl property must be an absolute URL on the client side: e.g. " http://mydomain.com/default.aspx" not "default.aspx".
set_imageUrlstringnoneSets the URL of the image.
get_imageUrlnonestringGets the URL of the image.
set_hoveredImageUrlstringnoneSets the URL of the image displayed when the mouse if over the item.
get_hoveredImageUrlnonestringGets the URL of the image displayed when the mouse if over the item.
get_cssClassnonestringGets the CssClass property of the item.
set_cssClassstringnoneSets the CssClass property for the item.
get_clickedCssClassnonestringGets the CSS class for the item when it is clicked.
set_clickedCssClassstringnoneSets the CSS class for the item when it is clicked.
get_focusedCssClassnonestringGets the CSS class for the item when it has focus.
set_focusedCssClassstringnoneSets the CSS class for the item when it has focus.
get_expandedCssClassnonestringGets the CSS class for the item when it is expanded.
set_expandedCssClassstringnoneSets the CSS class for the item when it is expanded.
get_disabledCssClassnonestringGets the CSS class for the item when it is disabled.
set_disabledCssClassstringnoneSets the CSS class for the item when it is disabled.
get_elementnoneHTML ElementGets the root DOM element of the item (LI).
get_linkElementnoneHTML ElementGets the anchor DOM element of the item (A).
get_imageElementnoneHTML ElementGets the image DOM element of the item. If the server side ImageUrl property is not set,returns null.
get_textElementnoneHTML ElementGets the DOM element of the item text (SPAN).
get_childListElementnoneHTML ElementGets the DOM element of the list of child items (UL).
clicknonenonePerforms an item click. If a the ItemClick server event is wired, it will be fired.
shownonenoneMakes the item visible.
hidenonenoneMakes the item invisible.
set_visiblebooleannoneShows/Hides a RadPanelItem

Example 1: Disable the item with text Paris.

JavaScript
	
var panelBar = $find("<%= RadPanelBar1.ClientID %>");
var panelItem = panelBar.findItemByText("Paris"); 
panelItem.disable();
	

Example 2: Focus the item.

JavaScript
	
var panelBar = $find("<%= RadPanelBar1.ClientID %>");
var panelItem = panelBar.findItemByText("Paris"); 
panelItem.focus();
	

Example 3: Remove the focus from the item.

JavaScript
		
var panelBar = $find("<%= RadPanelBar1.ClientID %>");
var panelItem = panelBar.findItemByText("Paris"); 
panelItem.blur();
	

Example 4: Set an item's attribute.

JavaScript
		
var panelBar = $find("<%= RadPanelBar1.ClientID %>");
var foundItem = panelBar.findItemByAttribute("Population", "0");
var attributes = foundItem.get_attributes();
var size = attributes.getAttribute("size");
if (size) {
    attributes.setAttribute("Population", size);
    attributes.removeAttribute("size");
}
else {
    attributes.setAttribute("Population", "Unknown"); 
}
	

See Also

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