<ClientEvents OnRowSelected="RowSelected" />. I got this error:
XMLHttpPanel Callback Loading Error:
Exception=The target 'contentControl$RadXmlHttpPanel1' for callback could not be found or did not implement ICallBackEventHandler (screenshot attached). I am following your TELERIK.SALESDASHBOARD demo with some modifications. Below are the source codes that cause this error
.aspx codes:
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="BatchDetails.ascx.vb" Inherits="Controls_DocumentInquiry_BatchDetails" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
<script type="text/javascript">
function RowSelected(sender, eventArgs)
{
var orderID = sender.get_masterTableView().get_dataItems()[eventArgs.get_itemIndexHierarchical()].getDataKeyValue("BatchNumber");
alert(orderID);
var oXmlPanel = $find("<%= RadXmlHttpPanel1.ClientID %>");
oXmlPanel.set_value(orderID);
}
</script>
</telerik:RadScriptBlock>
<div class="batchesContainer">
<asp:Label runat="server" ID="batchdetailsTitle" CssClass="detailsTitle">Orders for</asp:Label>
<div class="pageNav">
<asp:LinkButton runat="server" ID="prevPage" CssClass="prevPage">Previous</asp:LinkButton>
<asp:LinkButton runat="server" ID="nextPage" CssClass="nextPage">Next</asp:LinkButton>
</div>
<div class="batchDetails">
<div class="batchdetailsGrid">
<telerik:RadGrid AllowFilteringByColumn="true" AllowSorting="true" ShowGroupPanel="false" Height="300px" BackColor="#393939"
ID="rgBatchDetails" runat="server" AllowPaging="true" PageSize="10" Width="480px"
OnPreRender="rgBatchDetails_PreRender" OnNeedDataSource="rgBatchDetails_NeedDataSource" OnSelectedIndexChanged="rgBatchDetails_SelectedIndexChanged" >
<ClientSettings AllowDragToGroup="true" EnableRowHoverStyle="true">
<Selecting AllowRowSelect="true" />
<ClientEvents OnRowSelected="RowSelected" />
</ClientSettings>
<MasterTableView AutoGenerateColumns="false" PagerStyle-Mode="NextPrevAndNumeric" ClientDataKeyNames="BatchNumber,ImageFile"
TableLayout="Fixed">
<Columns>
<telerik:GridBoundColumn DataField="BatchNumber" HeaderText="Batch Number" AutoPostBackOnFilter="true" ShowFilterIcon="false" HeaderStyle-Width="60px" FilterControlWidth="35px">
</telerik:GridBoundColumn>
<telerik:GridNumericColumn DataField="ImageFile" HeaderText="Image File" AutoPostBackOnFilter="true" ShowFilterIcon="false" HeaderStyle-Width="60px" FilterControlWidth="35px">
</telerik:GridNumericColumn>
<telerik:GridBoundColumn DataField="MICRValue" HeaderText="MICR/OCR" HeaderStyle-Width="300px" FilterControlWidth="260px">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Amount" HeaderText="Amount" FilterControlWidth="70px">
</telerik:GridBoundColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
</div>
<div class="batchdetailsImage">
<telerik:RadXmlHttpPanel ID="RadXmlHttpPanel1" runat="server" OnServiceRequest="RadXmlHttpPanel1_ServiceRequest" RenderMode="Block">
<asp:Image ID="imgDocumentImage" runat="server" Height="300px" Width="500px"/>
</telerik:RadXmlHttpPanel>
</div>
</div>
<telerik:RadAjaxLoadingPanel ID="BatchesLoadingPanel" runat="server"></telerik:RadAjaxLoadingPanel>
</div>
.vb codes:
When I click a TreeNode (LoadOnDemand: TreeNodeExpandMode.ServerSideCallBack) on the main aspx page, it would load this control.
Imports
Telerik.Web.UI
Imports
System
Imports
System.Linq
Imports
System.Linq.Expressions
Imports
System.Web.UI
Imports
System.Data
Partial
Class Controls_DocumentInquiry_BatchDetails
Inherits ContentControl
Protected Sub RadXmlHttpPanel1_ServiceRequest(ByVal source As Object, ByVal e As RadXmlHttpPanelEventArgs) Handles RadXmlHttpPanel1.ServiceRequest
Dim BatchNumber = e.Value.ToString
imgDocumentImage.ImageUrl = "Image.aspx?ImageLocation=00000481.TIF"
End Sub
Protected
Sub Page_PreRender(ByVal sender As Object, ByVal e As EventArgs)
Dim ajaxManager As RadAjaxManager = RadAjaxManager.GetCurrent(Page)
ajaxManager.AjaxSettings.AddAjaxSetting(rgBatchDetails, rgBatchDetails, BatchesLoadingPanel)
End Sub
Protected Sub rgBatchDetails_PreRender(ByVal sender As Object, ByVal e As EventArgs)
If rgBatchDetails.MasterTableView.Items.Count > 0 And rgBatchDetails.SelectedItems.Count = 0 Then
rgBatchDetails.MasterTableView.Items(0).Selected =
True
End If
End Sub
Protected Sub rgBatchDetails_NeedDataSource(ByVal source As Object, ByVal e As GridNeedDataSourceEventArgs)
If Session("dsBatchData") Is Nothing Then
Else
rgBatchDetails.DataSource = Session(
"dsBatchData")
End If
End Sub
Thank you
Quan