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

OnClientTileSelecting

The OnClientTileSelecting event is raised just before a tileis selected. It is cancellable and precedes the OnClientTileSelected event. If it is cancelled the OnClientTileSelected event is not raised.

This event can be used to prevent selection based on a certain criteria (e.g. information for the tile that is about to be selected). Cancelling this event will prevent the postback and the selection.

The event handler receives two arguments:

  1. the RadTileList object that fired the event

  2. an event arguments object that exposes the following methods

OnClientTileSelecting event arguments object

NameReturn typeArgumentsDescription
get_cancel()boolGets a value that indicates whether the event is cancelled.
get_tile()RadBaseTile client-side objectGets a reference to the tile that is about to be selected.
get_value()boolReturns true if the tile is selected.
set_cancel(value)boolSets whether the event will be cancelled (if true is passed).

The following example shows how to get information about a tile using the OnClientTileSelecting event of the RadTileList. Note that the event is cancellable and that selection is performed by right-clicking on a tile.

JavaScript
<telerik:RadTileList RenderMode="Lightweight" runat="server" ID="RadTileList1" AutoPostBack="false" SelectionMode="Single" OnClientTileSelecting="OnClientTileSelecting">
	<Groups>
		<telerik:TileGroup>
			<telerik:RadTextTile Name="Sample Text Tile" Text="Lorem ipsum dolor sit amet" Title-Text="Sample"></telerik:RadTextTile>
		</telerik:TileGroup>
	</Groups>
</telerik:RadTileList>

<script type="text/javascript">
	function OnClientTileSelecting(tileList, args) {
		var tile = args.get_tile();
		var response = confirm(String.format("Toggle the selection of {0}?", tile.get_name()));
		if (!response) {
			args.set_cancel(true);
		}
	}
</script>
Not finding the help you need?
Contact Support