This is a migrated thread and some comments may be shown as answers.

RadGrid / RadComboBox / EditForm

3 Answers 92 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dimitrios
Top achievements
Rank 1
Dimitrios asked on 11 Mar 2015, 01:59 PM
I get the following error, when I click on the RadComboBox to get the items :

The target 'ctl00$MainContent$grdAlum&ctl00$ctl05$EditFormControl$cmbUnPrLot' for the callback could not be found or did not implement ICCallbackEventHandler



Here is the relative code.

.aspx
 <telerik:RadScriptManager ID="RadScriptManager1"
    EnablePageMethods="true" runat="server">
    <Services>
      <asp:ServiceReference Path="~/SessionAccessService.asmx" />
    </Services>
  </telerik:RadScriptManager>
  <telerik:RadSkinManager ID="QsfSkinManager" runat="server" ShowChooser="false" />
  <telerik:RadFormDecorator ID="QsfFromDecorator" runat="server" DecoratedControls="All"
    EnableRoundedCorners="false" />
  <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
  <script type="text/javascript">
...
  </script>

  </telerik:RadCodeBlock>
  <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
      <telerik:AjaxSetting AjaxControlID="grdDetails">
        <UpdatedControls>
          <telerik:AjaxUpdatedControl ControlID="grdDetails"
            LoadingPanelID="RadAjaxLoadingPanel1"></telerik:AjaxUpdatedControl>
        </UpdatedControls>
      </telerik:AjaxSetting>
    </AjaxSettings>
  </telerik:RadAjaxManager>

  <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
  </telerik:RadAjaxLoadingPanel>
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true">
    </telerik:RadWindowManager>

...

          <telerik:RadGrid ID="grdAlum" runat="server"
            Width="550px" Height="200px"
            AllowPaging="True" PageSize="4"
            PagerStyle-PageSizeControlType="None"
            ShowFooter="true"
            PagerStyle-PageButtonCount="4" AutoGenerateColumns="False"
            OnUpdateCommand="grdAlum_UpdateCommand"
            OnItemDataBound="grdAlum_ItemDataBound"
            OnNeedDataSource="grdAlum_NeedDataSource"
            AllowAutomaticInserts="false"
            ShowStatusBar="false" Skin="Vista">

            <MasterTableView Width="100%" CommandItemDisplay="none"
              DataKeyNames="ODUA_ID, ODUA_Itm_ID, ODUA_Lot_ID"
              CommandItemSettings-AddNewRecordText="" AllowSorting="False"
              CommandItemSettings-ShowRefreshButton="False"
              CommandItemSettings-AddNewRecordImageUrl=""
              CommandItemStyle-HorizontalAlign="center"
              CommandItemStyle-BorderStyle="None">

              <EditFormSettings UserControlName="OrderAlum.ascx"
                EditFormType="WebUserControl">
                <EditColumn ButtonType="ImageButton" />
                <PopUpSettings Width="550px" Modal="true" />
              </EditFormSettings>

              <Columns>
...
            </Columns>
            </MasterTableView>
            <ClientSettings Selecting-AllowRowSelect="true" EnableRowHoverStyle="true">
              <Scrolling AllowScroll="True" UseStaticHeaders="True"
                SaveScrollPosition="true"></Scrolling>
              <ClientEvents OnRowDblClick="RowDblClick" OnRowClick="RowClick" />
            </ClientSettings>
          </telerik:RadGrid>


OrderAlum.ascx
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="OrderAlum.ascx.vb"
  Inherits="EditFormOrderAlum.OrderAlum" %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>

<telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="false" />
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
</telerik:RadAjaxManager>

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
</telerik:RadAjaxLoadingPanel>


<telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true">
</telerik:RadWindowManager>

<asp:Table.......

<telerik:RadComboBox runat="server" ID="cmbUnPrLot"
        Height="190px" Width="320px" Skin="Vista"
        EnableLoadOnDemand="true" ItemsPerRequest="5"
        DataTextField="Lot_Number" DataValueField="Inv_ID" 
        HighlightTemplatedItems="true" ExpandDelay="0"
        ExpandAnimation-Duration="0" CollapseAnimation-Duration="0"
        CollapseDelay="0" LoadingMessage="Loading ..." 
        OnItemsRequested="cmbUnPrLot_ItemsRequested">
      </telerik:RadComboBox>


OrderAlum.ascx.vb

Imports System.Data.SqlClient
Imports System
Imports System.Data
Imports System.Collections
Imports System.Web.UI
Imports Telerik.Web.UI

Namespace EditFormOrderAlum

  Class OrderAlum
    Inherits System.Web.UI.UserControl
    Implements INamingContainer

    Private _dataItem As Object = Nothing

#Region "Web Form Designer generated code"

    Protected Overrides Sub OnInit(ByVal e As EventArgs)
      InitializeComponent()
      MyBase.OnInit(e)
    End Sub

    Private Sub InitializeComponent()
      AddHandler DataBinding, AddressOf Me.OrderAlum_DataBinding
    End Sub

#End Region

    Protected Sub Page_Load(sender As Object, e As EventArgs)
    End Sub

    Public Property DataItem() As Object
      Get
        Return Me._dataItem
      End Get
      Set(ByVal value As Object)
        Me._dataItem = value
      End Set
    End Property

    Protected Sub cmbUnPrLot_ItemsRequested(ByVal sender As Object, ByVal e As RadComboBoxItemsRequestedEventArgs)
      Dim SQLSelectCommand As SqlCommand
      Dim SQLDBConnString As String = ConfigurationManager.ConnectionStrings("NewERPConnectionString").ToString()
      Dim SQLDBConn As New SqlConnection(SQLDBConnString)
      SQLDBConn.Open()
      SQLSelectCommand = New SqlCommand("dbo.spGetUnPrAlumLots", SQLDBConn)
      SQLSelectCommand.CommandType = CommandType.StoredProcedure
      SQLSelectCommand.Parameters.AddWithValue("@Lot_Itm_ID", ddlUnPrItemCode.SelectedValue.ToString)
      Dim dt As New DataTable()
      Dim adp As New SqlDataAdapter
      adp.SelectCommand = SQLSelectCommand
      adp.Fill(dt)

      For Each dataRow As DataRow In dt.Rows
        Dim item As New RadComboBoxItem()
        item.Text = DirectCast(dataRow("Lot_Number"), String)
        item.Value = dataRow("Inv_ID").ToString()
        Dim InvQty As Decimal = DirectCast(dataRow("Inv_Quantity"), Decimal)
        Dim InvLoc As Long = DirectCast(dataRow("Inv_Lov_ID"), Long)
        item.Attributes.Add("Inv_Quantity", InvQty.ToString())
        item.Attributes.Add("Inv_Lov_ID", InvLoc.ToString())
        '        item.Value += ":" + unitPrice.ToString()
        cmbUnPrLot.Items.Add(item)
        item.DataBind()
      Next
    End Sub

    Protected Sub OrderAlum_DataBinding(ByVal sender As Object, ByVal e As System.EventArgs)
......


I would appreciate any help - Thanks

3 Answers, 1 is accepted

Sort by
0
Angel Petrov
Telerik team
answered on 16 Mar 2015, 11:48 AM
Hello Dimitrios,

Based on the information provided it would be hard to tell what exactly is causing the illustrated behavior. Generally such problems occur in scenarios when the controls are added dynamically which does not seem to be the case. That said I would kindly like to ask you to send us a small runnable sample which we can inspect. That way we should be able to quickly find the root cause of the issue.

Regards,
Angel Petrov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Dimitrios
Top achievements
Rank 1
answered on 17 Mar 2015, 10:52 AM
Hello Angel,

Thanks for your time looking at this problem.

Unfortunately, the error was completely misleading! I had a problem with my stored procedure (dbo.spGetUnPrAlumLots --> wrong linking) which fed data to the control. When that was fixed, the control worked fine.

Sorry to load you with all this code...

Thanks again
0
Viktor Tachev
Telerik team
answered on 19 Mar 2015, 03:59 PM
Hello Dimitrios,

Thank you for sharing your experience with the community. It could help someone that experiences similar behavior.

Regards,
Viktor Tachev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Dimitrios
Top achievements
Rank 1
Answers by
Angel Petrov
Telerik team
Dimitrios
Top achievements
Rank 1
Viktor Tachev
Telerik team
Share this question
or