RadPanelItem
This partial Class defines RadPanelItem object that inherits NavigationItem, IRadPanelItemContainer and ICloneable.
The RadPanelBar control is made up of items. Items which are immediate children of the panelbar are root items. Items which are children of root items are child items.
A item usually stores data in two properties, the Text property and the Value property. The value of the Text property is displayed in the RadPanelBar control, and the Value property is used to store additional data.
To create panel items, use one of the following methods:
- Use declarative syntax to define items inline in your page or user control.
- Use one of the constructors to dynamically create new instances of the RadPanelItem class. These items can then be added to the Items collection of another item or panelbar.
- Data bind the RadPanelBar control to a data source.
When the user clicks a panel item, the RadPanelBar control can navigate to a linked Web page, post back to the server or select that item. If the NavigateUrl property of a item is set, the RadPanelBar control navigates to the linked page. By default, a linked page is displayed in the same window or frame. To display the linked content in a different window or frame, use the Target property.
Definition
Namespace:Telerik.Web.UI
Assembly:Telerik.Web.UI.dll
Syntax:
public class RadPanelItem : NavigationItem, IComponent, IDisposable, IParserAccessor, IUrlResolutionService, IDataBindingsAccessor, IControlBuilderAccessor, IControlDesignerAccessor, IExpressionsAccessor, IAttributeAccessor, IMarkableStateManager, IStateManager, INamingContainer, IXmlSerializable, IControlItemContainer, IRadPanelItemContainer, ICloneable
Inheritance: objectControlWebControlControlItemNavigationItemRadPanelItem...
Implements:
Inherited Members
Constructors
Initializes a new instance of the RadPanelItem class.
public RadPanelItem()
Use this constructor to create and initialize a new instance of the RadPanelItem class using default values.
Initializes a new instance of the RadPanelItem class with the specified text and URL to navigate to.
public RadPanelItem(string text, string navigateUrl)
The text of the item. The Text property is set to the value of this parameter.
navigateUrlstringThe url which the item will navigate to. The NavigateUrl property is set to the value of this parameter.
Use this constructor to create and initialize a new instance of the RadPanelItem class using the specified text and URL.
Initializes a new instance of the RadPanelItem class with the specified text data.
public RadPanelItem(string text)
The text of the item. The Text property is set to the value of this parameter.
Use this constructor to create and initialize a new instance of the RadPanelItem class using the specified text.
Properties
Gets or sets the Cascading Style Sheet (CSS) class applied to the element enclosing the child items.
public string ChildGroupCssClass { get; set; }
The default value is empry string.
Gets or sets the height of the child item group.
public Unit ChildGroupHeight { get; set; }
A Unit that represents the height of the child item group. The default value is Empty.
If the total child group height exceeds the value specified with the ChildGroupHeight property scrolling will be applied.
Gets or sets the Cascading Style Sheet (CSS) class applied when the panel item is clicked.
public string ClickedCssClass { get; set; }
The CSS class applied when the panel item is clicked. The default value is "clicked".
Gets or sets the content template.
[Bindable(false)]
[Browsable(false)]
[PersistenceMode(PersistenceMode.InnerProperty)]
[TemplateContainer(typeof(RadPanelItem))]
[TemplateInstance(TemplateInstance.Single)]
public virtual ITemplate ContentTemplate { get; set; }
The content template.
Gets or sets the data item represented by the item.
[Browsable(false)]
public override object DataItem { get; set; }
An object representing the data item to which the Item is bound to. The DataItem property will always return null when accessed outside of ItemDataBound event handler.
Overrides:
This property is applicable only during data binding. Use it along with the ItemDataBound event to perform additional mapping of fields from the data item to RadPanelItem properties.
Gets or sets the Cascading Style Sheet (CSS) class applied when the panel item is disabled.
public string DisabledCssClass { get; set; }
The CSS class applied when the panel item is disabled. The default value is "disabled".
By default the visual appearance of disabled panel items is defined in the skin CSS file. You can use the DisabledCssClass property to specify unique appearance for the panel item when it is disabled.
Gets or sets the path to an image to display for the item when it is disabled.
public string DisabledImageUrl { get; set; }
The path to the image to display for the item. The default value is empty string.
Use the DisabledImageUrl property to specify the image for the item when it is disabled. If the DisabledImageUrl property is set to empty string no image will be rendered. Use "~" (tilde) when referring to images within the current ASP.NET application.
Gets or sets a value indicating whether the panel item is expanded.
public bool Expanded { get; set; }
true if the panel item is expanded; otherwise, false. The default is false.
Gets or sets the Cascading Style Sheet (CSS) class applied when the panel item is opened (its child items are visible).
public string ExpandedCssClass { get; set; }
The CSS class applied when the panel item is opened. The default value is "expanded".
By default the visual appearance of opened panel items is defined in the skin CSS file. You can use the ExpandedCssClass property to specify unique appearance for the panel item when it is opened.
Gets or sets the path to an image to display for the item when it is expanded.
public string ExpandedImageUrl { get; set; }
The path to the image to display for the item. The default value is empty string.
Use the ExpandedImageUrl property to specify the image for the item when it is expanded. If the ExpandedImageUrl property is set to empty string no image will be rendered. Use "~" (tilde) when referring to images within the current ASP.NET application.
Gets or sets the Cascading Style Sheet (CSS) class applied when the panel item is focused.
public string FocusedCssClass { get; set; }
The CSS class applied when the panel item is focused. The default value is "focused".
By default the visual appearance of focused panel items is defined in the skin CSS file. You can use the FocusedCssClass property to specify unique appearance for the panel item when it is focused.
Get the Header Template container of the RadPanelItem.
[Browsable(false)]
public RadPanelItemHeaderTemplateContainer Header { get; }
Gets or sets the template for displaying footer in RadcomboBox.
[Bindable(false)]
[Browsable(false)]
[PersistenceMode(PersistenceMode.InnerProperty)]
[TemplateContainer(typeof(RadPanelItemHeaderTemplateContainer))]
[TemplateInstance(TemplateInstance.Single)]
public virtual ITemplate HeaderTemplate { get; set; }
Gets or sets a value specifying the URL of the image rendered when the node is hovered with the mouse.
public override string HoveredImageUrl { get; set; }
Overrides:
If the
HoveredImageUrlproperty is not set the ImageUrl property will be used when the node is hovered.
Gets or sets a value indicating the position of the image within the item.
public RadPanelItemImagePosition ImagePosition { get; set; }
One of the Telerik.Web.UI.RadPanelItemImagePosition?text=RadPanelItemImagePosition ++++++++++++++++Enumeration values. The default value is Left.
Gets or sets the path to an image to display for the item.
public override string ImageUrl { get; set; }
The path to the image to display for the item. The default value is empty string.
Overrides:
Use the ImageUrl property to specify the image for the item. If the ImageUrl property is set to empty string no image will be rendered. Use "~" (tilde) when referring to images within the current ASP.NET application.
Sets or gets whether the item is separator. It also represents a logical state of the item. Might be used in some applications for keyboard navigation to omit processing items that are marked as separators.
public bool IsSeparator { get; set; }
Gets the collection of child items.
[Browsable(false)]
[PersistenceMode(PersistenceMode.InnerProperty)]
public RadPanelItemCollection Items { get; }
A RadPanelItemCollection that represents the child items.
Implements:
Use this property to retrieve the child items. You can also use it to programmatically add or remove items.
Gets or sets the template for displaying the item.
[TemplateContainer(typeof(RadPanelItem))]
[PersistenceMode(PersistenceMode.InnerProperty)]
[Browsable(false)]
[Bindable(false)]
public virtual ITemplate ItemTemplate { get; set; }
A ITemplate implemented object that contains the template for displaying the item. The default value is a null reference (Nothing in Visual Basic), which indicates that this property is not set.
To specify common display for all panel items use the ItemTemplate property of the RadPanelbar class.
Manages the item level of a particular Item instance. This property allows easy implementation/separation of the panel items in levels.
[Browsable(false)]
public int Level { get; }
Gets or sets the URL to link to when the item is clicked.
[Bindable(true)]
public override string NavigateUrl { get; set; }
The URL to link to when the item is clicked. The default value is empty string.
Overrides:
Use the NavigateUrl property to specify the URL to link to when the item is clicked. Use "~" (tilde) in front of an URL within the same ASP.NET application. When specifying external URL do not forget the protocol (e.g. "http://").
Gets the IRadPanelItemContainer instance which contains the current item.
[Browsable(false)]
public IRadPanelItemContainer Owner { get; }
The object which contains the item. It might be an instance of the RadPanelBar class or the RadPanelItem class depending on the hierarchy level.
Implements:
The value is of the IRadPanelItemContainer type which is implemented by the RadPanelBar class and the RadPanelItem class. Use the Owner property when recursively traversing items in the RadPanelBar control.
Gets the RadPanelBar instance which contains the item.
[Browsable(false)]
public RadPanelBar PanelBar { get; }
Use this property to obtain an instance to the RadPanelBar object containing the item.
Gets or sets a value indicating whether clicking on the item will postback.
public bool PostBack { get; set; }
True if the panel item should postback; otherwise false. By default all the items will postback provided the user has subscribed to the ItemClick event.
If you subscribe to the ItemClick all panel items will postback. To turn off that behavior you should set the PostBack property to false.
Gets or sets a value indicating whether clicking on the item will collapse it.
public bool PreventCollapse { get; set; }
False if the panel item should collapse; otherwise True.
protected override IDictionary<string, string> PropertyMappings { get; }
Overrides:
Gets or sets a value indicating whether the item is selected.
public bool Selected { get; set; }
true if the item is selected; otherwise, false. The default is false.
Use the Selected property to determine whether the item is currently selected.
Gets or sets the Cascading Style Sheet (CSS) class applied when the panel item is selected.
public string SelectedCssClass { get; set; }
The CSS class applied when the panel item is selected. The default value is "selected".
By default the visual appearance of selected panel items is defined in the skin CSS file. You can use the SelectedCssClass property to specify unique appearance for the panel item when it is selected.
Gets or sets the path to an image to display for the item when it is selected.
public string SelectedImageUrl { get; set; }
The path to the image to display for the item. The default value is empty string.
Use the SelectedImageUrl property to specify the image for the item when it is disabled. If the SelectedImageUrl property is set to empty string no image will be rendered. Use "~" (tilde) when referring to images within the current ASP.NET application.
protected override HtmlTextWriterTag TagKey { get; }
Overrides:
Gets or sets the target window or frame to display the Web page content linked to when the panel item is clicked.
[TypeConverter(typeof(TargetConverter))]
public override string Target { get; set; }
The target window or frame to load the Web page linked to when the Item is selected. Values must begin with a letter in the range of a through z (case insensitive), except for the following special values, which begin with an underscore:
The default value is empty string.
Overrides:
Use the Target property to specify the frame or window that displays the Web page linked to when the panel item is clicked. The Web page is specified by setting the NavigateUrl property.
If this property is not set, the Web page specified by the NavigateUrl property is loaded in the current window.
Gets or sets the text caption for the panel item.
public override string Text { get; set; }
The text of the item. The default value is empty string.
Overrides:
Use the Text property to specify the text to display for the item.
Methods
protected override void AddAttributesToRender(HtmlTextWriter writer)
Overrides:
Instantiates the HeaderTemplate inside the Header. Clears all existing controls in the Header before that.
public void ApplyHeaderTemplate()
Clones this instance.
protected override ControlItemCollection CreateChildItemCollection()
Overrides:
Expands all parent items so the item is visible.
public void ExpandParentItems()
protected override void LoadFromDictionary(IDictionary<string, object> dictionary)
Overrides:
protected override void RenderContents(HtmlTextWriter writer)
Overrides: