New to Telerik UI for ASP.NET AJAX? Start a free 30-day trial

RadLightBox control. See the Overview topic for more information.

Definition

Namespace:Telerik.Web.UI

Assembly:Telerik.Web.UI.dll

Syntax:

C#
[ToolboxBitmap(typeof(RadLightBox), "Telerik.Web.UI.LightBox.png")]
[TelerikToolboxCategory("Data")]
[RequiredScript(typeof(Core), 1)]
[RequiredScript(typeof(jQueryPlugins), 2)]
[RequiredScript(typeof(ImageAnimations), 3)]
[RequiredCss("Telerik.Web.UI.Skins.Common.MaterialRipple.css", RenderMode.Lightweight, typeof(RadLightBox))]
[RequiredScript(typeof(MaterialRipple))]
[ClientScriptResource("Telerik.Web.UI.RadLightBox", "Telerik.Web.UI.LightBox.RadLightBoxScripts.js")]
[RequiredCss("Telerik.Web.UI.Skins.Common.fonticons.css", RenderMode.Lightweight, typeof(RadGrid))]
[EmbeddedSkin("LightBox")]
[EmbeddedSkin("LightBox", "Default")]
[RequiredCss("Telerik.Web.UI.Skins.Common.fonticons.css", RenderMode.Lightweight, typeof(RadLightBox))]
[RequiredCss("Telerik.Web.UI.Skins.Common.fonticons.css", RenderMode.Mobile, typeof(RadLightBox))]
public class RadLightBox : RadDataBoundControl, IComponent, IDisposable, IParserAccessor, IUrlResolutionService, IDataBindingsAccessor, IControlBuilderAccessor, IControlDesignerAccessor, IExpressionsAccessor, IAttributeAccessor, IScriptControl, IControlResolver, IPostBackDataHandler, ISkinnableControl, IControl, IFeatureGroup, INamingContainer, IPostBackEventHandler

Inheritance: objectControlWebControlBaseDataBoundControlDataBoundControlRadDataBoundControlRadLightBox...

Implements: IAttributeAccessorIComponentIControlIControlBuilderAccessorIControlDesignerAccessorIControlResolverIDataBindingsAccessorIDisposableIExpressionsAccessorIFeatureGroupINamingContainerIParserAccessorIPostBackDataHandlerIPostBackEventHandlerIScriptControlISkinnableControlIUrlResolutionService...

Inherited Members DataBoundControl.OnCreatingModelDataSource(CreatingModelDataSourceEventArgs)DataBoundControl.CreateDataSourceSelectArguments()DataBoundControl.GetData()DataBoundControl.GetDataSource()DataBoundControl.MarkAsDataBound()DataBoundControl.OnDataPropertyChanged()DataBoundControl.OnDataSourceViewChanged(object, EventArgs)DataBoundControl.OnPagePreLoad(object, EventArgs)DataBoundControl.PerformSelect()DataBoundControl.ValidateDataSource(object)DataBoundControl.DataMemberDataBoundControl.IsUsingModelBindersDataBoundControl.ItemTypeDataBoundControl.SelectMethodDataBoundControl.DataSourceIDDataBoundControl.DataSourceObjectDataBoundControl.SelectArgumentsDataBoundControl.CreatingModelDataSourceDataBoundControl.CallingDataMethodsBaseDataBoundControl.ConfirmInitState()BaseDataBoundControl.DataBind()BaseDataBoundControl.EnsureDataBound()BaseDataBoundControl.OnDataBound(EventArgs)BaseDataBoundControl.OnInit(EventArgs)BaseDataBoundControl.DataSourceBaseDataBoundControl.InitializedBaseDataBoundControl.IsBoundUsingDataSourceIDBaseDataBoundControl.IsDataBindingAutomaticBaseDataBoundControl.SupportsDisabledAttributeBaseDataBoundControl.RequiresDataBindingBaseDataBoundControl.DataBoundWebControl.AddAttributesToRender(HtmlTextWriter)WebControl.ApplyStyle(Style)WebControl.CopyBaseAttributes(WebControl)WebControl.CreateControlStyle()WebControl.MergeStyle(Style)WebControl.RenderBeginTag(HtmlTextWriter)WebControl.RenderEndTag(HtmlTextWriter)WebControl.AccessKeyWebControl.AttributesWebControl.BackColorWebControl.BorderColorWebControl.BorderWidthWebControl.BorderStyleWebControl.ControlStyleWebControl.ControlStyleCreatedWebControl.CssClassWebControl.DisabledCssClassWebControl.StyleWebControl.EnabledWebControl.EnableThemingWebControl.FontWebControl.ForeColorWebControl.HasAttributesWebControl.HeightWebControl.IsEnabledWebControl.SkinIDWebControl.TagNameWebControl.ToolTipWebControl.WidthControl.ResolveAdapter()Control.HasEvents()Control.GetRouteUrl(object)Control.GetRouteUrl(string, object)Control.GetRouteUrl(RouteValueDictionary)Control.GetRouteUrl(string, RouteValueDictionary)Control.GetUniqueIDRelativeTo(Control)Control.ApplyStyleSheetSkin(Page)Control.OnDataBinding(EventArgs)Control.DataBind(bool)Control.DataBindChildren()Control.AddParsedSubObject(object)Control.EnsureID()Control.ClearChildState()Control.ClearChildControlState()Control.ClearChildViewState()Control.ClearEffectiveClientIDMode()Control.ClearCachedClientID()Control.Focus()Control.MapPathSecure(string)Control.OpenFile(string)Control.BuildProfileTree(string, bool)Control.RenderChildren(HtmlTextWriter)Control.RenderControl(HtmlTextWriter)Control.RenderControl(HtmlTextWriter, ControlAdapter)Control.OnUnload(EventArgs)Control.Dispose()Control.RaiseBubbleEvent(object, EventArgs)Control.OnBubbleEvent(object, EventArgs)Control.AddedControl(Control, int)Control.CreateControlCollection()Control.ResolveUrl(string)Control.ResolveClientUrl(string)Control.FindControl(string)Control.FindControl(string, int)Control.GetDesignModeState()Control.HasControls()Control.IsLiteralContent()Control.EnsureChildControls()Control.RemovedControl(Control)Control.SetDesignModeState(IDictionary)Control.SetRenderMethodDelegate(RenderMethod)Control.ClientIDModeControl.ClientIDControl.ClientIDSeparatorControl.ContextControl.AdapterControl.DesignModeControl.EventsControl.IDControl.IsChildControlStateClearedControl.EnableViewStateControl.ViewStateModeControl.IsViewStateEnabledControl.NamingContainerControl.IdSeparatorControl.LoadViewStateByIDControl.PageControl.RenderingCompatibilityControl.TemplateControlControl.ParentControl.TemplateSourceDirectoryControl.AppRelativeTemplateSourceDirectoryControl.SiteControl.VisibleControl.UniqueIDControl.HasChildViewStateControl.ControlsControl.ValidateRequestModeControl.ViewStateControl.ViewStateIgnoresCaseControl.ChildControlsCreatedControl.IsTrackingViewStateControl.DisposedControl.DataBindingControl.InitControl.LoadControl.PreRenderControl.Unloadobject.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()object.GetType()object.MemberwiseClone()...

Constructors

C#
public RadLightBox()

Fields

C#
public const string NavigateToCommandName = "NavigateTo"

Properties

Gets/sets a value that indicates whether list items are cleared before databinding

C#
public bool AppendDataBoundItems { get; set; }

RadLightBox Client Settings

C#
[TypeConverter(typeof(ExpandableObjectConverter))]
[PersistenceMode(PersistenceMode.InnerProperty)]
public LightBoxClientSettings ClientSettings { get; }

The CssClass property will now be used instead of the former Skin and will be modified in AddAttributesToRender()

C#
protected override string CssClassFormatString { get; }

Overrides: RadDataBoundControl.CssClassFormatString

Example:
C#
protected override string CssClassFormatString
{
       get
       {
           return "RadDock RadDock_{0} rdWTitle rdWFooter";
       }
}

Gets or sets the selected culture. Localization strings will be loaded based on this value.

C#
public CultureInfo Culture { get; set; }
Property Value:

The selected culture. Localization strings will be loaded based on this value.

Gets/sets the current item index

C#
public int CurrentItemIndex { get; set; }

The field in the data source which provides the description text.

C#
public string DataDescriptionField { get; set; }

The field in the data source which provides the ImageUrl.

C#
public string DataImageUrlField { get; set; }

This property enables setting a default path for the images when binding

C#
public string DataImageUrlFormatString { get; set; }

The field in the data source which provides the NavigateUrl.

C#
public string DataNavigateUrlField { get; set; }

The field in the data source which provides the target control's ID.

C#
public string DataTargetControlIDField { get; set; }

The field in the data source which provides the title text.

C#
public string DataTitleField { get; set; }

Determines the position of the RadLightBox title/description

C#
public LightBoxDescriptionPosition DescriptionPosition { get; set; }

Determines if the control will have WAI-ARIA support enabled

C#
public bool EnableAriaSupport { get; set; }

Enables or disables the "glow" effect around the control

C#
public bool EnableGlowEffect { get; set; }

RadLightBox Items Collection

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
[TypeConverter(typeof(ExpandableObjectConverter))]
public RadLightBoxItemCollection Items { get; }

Returns the items count

C#
[Browsable(false)]
public int ItemsCount { get; }

Gets/sets the items counter format string. The first parameter is the item index and the second is the total number of items. The second parameter is optional.

C#
public string ItemsCounterFormatString { get; set; }

The container that holds the description

C#
[Browsable(false)]
public PlaceHolder LightBoxDescriptionContainer { get; set; }

The container that holds the main content

C#
[Browsable(false)]
public PlaceHolder LightBoxItemContainer { get; set; }

The container that holds the title

C#
[Browsable(false)]
public PlaceHolder LightBoxTitleContainer { get; set; }

Gets or sets a value indicating where RadLightBox will look for its .resx localization file. By default this file should be in the App_GlobalResources folder. However, if you cannot put the resource file in the default location or .resx files compilation is disabled for some reason (e.g. in a DotNetNuke environment), this property should be set to the location of the resource file.

C#
public string LocalizationPath { get; set; }
Property Value:

A relative path to the dialogs location. For example: "~/controls/RadLightBoxResources/".

If specified, the LocalizationPath property will allow you to load the grid localization file from any location in the web application.

If enabled, this will loop the items when the last/first one is reached

C#
public bool LoopItems { get; set; }

Determines whether the RadLightBox is modal

C#
[ClientControlProperty]
[Browsable(true)]
[Bindable(true)]
public bool Modal { get; set; }
Property Value:

The default value is false

If set to true, this will prevent disposing of the current item's templates which will avoid the postback when only one template item is available in the items collection and the lightbox is closed and then re-opened. Disabled by default.

C#
public bool PreserveCurrentItemTemplates { get; set; }

See the RadLightBox Templates article for more detail: https://docs.telerik.com/devtools/aspnet-ajax/controls/lightbox/functionality/templates

Determines whether the Close button will be visible

C#
public bool ShowCloseButton { get; set; }

Determines whether the RadLightBox will display loading panel

C#
[Browsable(true)]
[Bindable(false)]
public bool ShowLoadingPanel { get; set; }
Property Value:

The default value is true

Determines whether the Maximize button will be visible

C#
public bool ShowMaximizeButton { get; set; }

Determines whether the Next button will be visible

C#
public bool ShowNextButton { get; set; }

Determines whether the Prev button will be visible

C#
public bool ShowPrevButton { get; set; }

Determines whether the Restore button will be visible

C#
public bool ShowRestoreButton { get; set; }
C#
protected override bool SupportsRenderingMode { get; }

Overrides: RadDataBoundControl.SupportsRenderingMode

Gets or sets the tab index of the RadLightBox control. Setting this to 0 will prevent the normal operation of the keyboard navigation.

C#
public override short TabIndex { get; set; }

Overrides: RadDataBoundControl.TabIndex

C#
protected override HtmlTextWriterTag TagKey { get; }

Overrides: WebControl.TagKey

Gets or sets the z-index of the LightBox popup

C#
[ClientControlProperty]
[ClientPropertyName("_zIndex")]
public int ZIndex { get; set; }

Methods

C#
protected override void CreateChildControls()

Overrides: Control.CreateChildControls()

C#
protected override void DescribeComponent(IScriptDescriptor descriptor)
Parameters:descriptorIScriptDescriptor

Overrides: RadDataBoundControl.DescribeComponent(IScriptDescriptor)

C#
protected override void LoadControlState(object savedState)
Parameters:savedStateobject

Overrides: Control.LoadControlState(object)

C#
protected virtual void LoadControlStateObject(object[] stateArray, int currentStateIndex)
Parameters:stateArrayobject[]currentStateIndexint
C#
protected override void LoadViewState(object savedState)
Parameters:savedStateobject

Overrides: DataBoundControl.LoadViewState(object)

Raises Command event

C#
protected virtual void OnCommand(LightBoxCommandEventArgs e)
Parameters:eLightBoxCommandEventArgs
C#
protected override void OnLoad(EventArgs e)
Parameters:eEventArgs

Overrides: DataBoundControl.OnLoad(EventArgs)

C#
protected override void OnPreRender(EventArgs e)
Parameters:eEventArgs

Overrides: RadDataBoundControl.OnPreRender(EventArgs)

C#
protected override void PerformDataBinding(IEnumerable data)
Parameters:dataIEnumerable

Overrides: DataBoundControl.PerformDataBinding(IEnumerable)

C#
protected override void Render(HtmlTextWriter writer)
Parameters:writerHtmlTextWriter

Overrides: RadDataBoundControl.Render(HtmlTextWriter)

C#
protected override void RenderContents(HtmlTextWriter writer)
Parameters:writerHtmlTextWriter

Overrides: RadDataBoundControl.RenderContents(HtmlTextWriter)

C#
protected override object SaveControlState()
Returns:

object

Overrides: Control.SaveControlState()

C#
protected virtual void SaveControlStateObject(IList state)
Parameters:stateIList
C#
protected override object SaveViewState()
Returns:

object

Overrides: DataBoundControl.SaveViewState()

C#
protected override void TrackViewState()

Overrides: DataBoundControl.TrackViewState()

Events

RadLightBox Command event

C#
public event EventHandler<LightBoxCommandEventArgs> Command