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

OnClientDataLoaded

The OnClientDataLoaded event is fired by the RadLiveTile when its data request has returned successfully. It can be used to change the information according to some custom logic or just for notification about the success of the operation.

The event handler receives two arguments:

  1. The RadLiveTile that fired the event

  2. An event arguments object that exposes the following members:

OnClientDataLoaded event arguments object members

Name Return type Arguments Description
get_data() object Returns the data object that is received from the service request.
set_data() object Sets a new data object that will be bound to the tile's template. It can be a modification of the original data.

The following example shows how some data can be modified according to a condition so it is presented to the user in a more meaningful manner:

<script type="text/javascript">
    function OnClientDataLoaded(sender, args)
    {
        var data = args.get_data();
        if (data.Violations == 0)
        {
            data.Violations = "No traffic violations.";
        }
        args.set_data(data);
    }
</script>
<telerik:RadLiveTile OnClientDataLoaded="OnClientDataLoaded" ID="RadLiveTile1"
                     runat="server" UpdateInterval="7000">
    <WebServiceSettings Path="TrafficInformation.asmx" Method="GetTrafficDataPerPerson"></WebServiceSettings>
    <ClientTemplateAnimationSettings Animation="None" AnimationDuration="1000" Easing="" />
    <ClientTemplate>
        <div style="width:150px; height: 150px;">
            <img alt="" src="Img/Customers/#= CustomerID #.jpg" />
            <div style="color:black; font-weight: bold; position: absolute; bottom: 5px;">Violations: #= Violations #</div>
            </div>
    </ClientTemplate>
</telerik:RadLiveTile>
In this article