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

ImageGalleryItem Object

RadImageGallery exposes an ImageGalleryItemCollection available through the get_items() method. It contains the different RadImageGalleryItems which hold data related to a certain image. The properties for every RadImageGalleryItem are listed in the table below.

RadImageGalleryItem properties

NameParametersReturn TypeDescription
get_description()StringGets the related description.
get_height()StringReturns the height of the image.
get_imageUrl()StringReturns the URL of the image.
get_itemIndex()NumberGets the index of the particular item.
get_owner()Telerik.Web.UI.RadImageGalleryGets the parent of the current object.
get_thumbnailElement()HTML ElementReturns the related thumbnail element.
get_thumbnailUrl()StringReturns the URL of the thumbnail.
get_title()StringGets the title of the image.
get_width()StringReturns the width of the image.

The example below illustrates how you can use a property to extract a value from the RadImageGalleryItem. The logic shown traverses all the items and stores the titles in a collection.

ASPNET
<telerik:RadImageGallery RenderMode="Lightweight" ID="RadImageGallery1" runat="server" AllowPaging="true"
	DataSourceID="SqlDataSource1" Width="800px" DataTitleField="PhotoTitle" DataImageField="Photo" DataThumbnailField="Photo" >
</telerik:RadImageGallery>
JavaScript
function pageLoad() {
	var imageGallery = $find('<%=RadImageGallery1.ClientID%>'),
	items = imageGallery.get_items(),
	count = items.get_count(),
	titles = [];
	for (var i = 0; i < count; i++) {
		titles.push(items.getItem(i).get_title());
	}
}

See Also