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

RadAjaxManager does not work when you add a DropDownList in GridTemplateColumn

2 Answers 22 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Carlos
Top achievements
Rank 1
Carlos asked on 24 Oct 2018, 03:33 PM

When adding the RadDropDownList "ddlManifiestoVehiculo" the RadAjaxManager stopped working, what is the reason it does not work?

 

<telerik:RadAjaxManager ID="ramServicioVehiculo" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="ddlManifiesto">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="ddlEscotilla" />
                    <telerik:AjaxUpdatedControl ControlID="rgCargaManifestada" />
                    <telerik:AjaxUpdatedControl ControlID="ddlManifiestoVehiculo" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="ddlEscotilla">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="ddlManifiesto" />
                    <telerik:AjaxUpdatedControl ControlID="rgCargaManifestada" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="rgCargaManifestada">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rgCargaManifestada" LoadingPanelID="radpControlVehiculo" />
                    <telerik:AjaxUpdatedControl ControlID="rgDetalleChequeo" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="rgDetalleChequeo">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rgDetalleChequeo" LoadingPanelID="radpControlDetalleVehiculo" />
                    <telerik:AjaxUpdatedControl ControlID="lblMensaje" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="radpControlVehiculo" runat="server"></telerik:RadAjaxLoadingPanel>
    <telerik:RadAjaxLoadingPanel ID="radpControlDetalleVehiculo" runat="server"></telerik:RadAjaxLoadingPanel>
    <telerik:RadLabel ID="lblIdManifiesto" runat="server" Text="Manifiesto:"></telerik:RadLabel>
    <telerik:RadDropDownList ID="ddlManifiesto" runat="server" DataSourceID="sdsManifiesto"
        DataTextField="ManNave" DataValueField="man_id_manifiesto" DefaultMessage="Seleccione el manifiesto" ToolTip="Manifiestos" AutoPostBack="True" Width="220px">
    </telerik:RadDropDownList>
    <asp:SqlDataSource ID="sdsManifiesto" runat="server" ConnectionString='<%$ ConnectionStrings:csOp_SPC %>' SelectCommand="SELECT CONCAT(man_id_manifiesto, ' - ', man_nom_nave) AS ManNave, man_id_manifiesto FROM op_manifiesto WITH (NOLOCK) ORDER BY man_id_manifiesto DESC"></asp:SqlDataSource>
    <br />
    <telerik:RadLabel ID="lblEscotilla" runat="server" Text="Escotilla:"></telerik:RadLabel>
    <telerik:RadDropDownList ID="ddlEscotilla" runat="server" DataSourceID="sdsEscotilla"
        DataTextField="DsEscotilla" DataValueField="IxEscotilla" DefaultMessage="Seleccione la escotilla" ToolTip="Escotillas" AutoPostBack="True" Width="220px">
    </telerik:RadDropDownList>
    <asp:SqlDataSource ID="sdsEscotilla" runat="server" ConnectionString='<%$ ConnectionStrings:csOp_SPC %>' SelectCommand="SELECT TOP (SELECT arr_escotillas FROM ss_arribo WITH (NOLOCK) WHERE arr_manifiesto = @IdManifiesto) IxEscotilla, DsEscotilla FROM Escotilla WITH (NOLOCK)">
        <SelectParameters>
            <asp:ControlParameter ControlID="ddlManifiesto" PropertyName="SelectedValue" Name="IdManifiesto"></asp:ControlParameter>
        </SelectParameters>
    </asp:SqlDataSource>
    <br />
    <h6>Control del Chequeo</h6>
    <telerik:RadTabStrip runat="server" ID="rtsCV" MultiPageID="rmpCV" SelectedIndex="0">
        <Tabs>
            <telerik:RadTab PageViewID="rpvCargaManifestada" Text="Carga Manifestada"></telerik:RadTab>
            <telerik:RadTab PageViewID="rpvDetalleChequeo" Text="Detalle Chequeo"></telerik:RadTab>
        </Tabs>
    </telerik:RadTabStrip>
    <telerik:RadMultiPage runat="server" ID="rmpCV" SelectedIndex="0">
        <telerik:RadPageView runat="server" ID="rpvCargaManifestada">
            <telerik:RadGrid ID="rgCargaManifestada" runat="server" DataSourceID="sdsCargaManifestada" OnItemCommand="rgCargaManifestada_ItemCommand"
                AllowPaging="True" AllowSorting="True" AllowFilteringByColumn="True" Culture="es-ES" CssClass="RadGrid_ModernBrowsers"
                FilterType="HeaderContext" EnableHeaderContextMenu="true" EnableHeaderContextFilterMenu="true" PagerStyle-AlwaysVisible="true"
                EnableLinqExpressions="False" ShowGroupPanel="True">
 
                <GroupingSettings CollapseAllTooltip="Collapse all groups" CaseSensitive="False"></GroupingSettings>
 
                <ExportSettings FileName="Carga Manifestada" ExportOnlyData="True" HideStructureColumns="True" IgnorePaging="True" OpenInNewWindow="True">
                    <Excel Format="Xlsx" FileExtension="xlsx"></Excel>
                </ExportSettings>
 
                <ClientSettings AllowDragToGroup="True">
                    <Selecting AllowRowSelect="True"></Selecting>
                    <Resizing AllowColumnResize="true" ResizeGridOnColumnResize="false" AllowResizeToFit="true" />
                </ClientSettings>
 
                <MasterTableView DataKeyNames="IxMDC" DataSourceID="sdsCargaManifestada" AutoGenerateColumns="False" CommandItemDisplay="Top">
                    <CommandItemSettings ShowAddNewRecordButton="false"></CommandItemSettings>
                    <Columns>
                        <telerik:GridBoundColumn DataField="IxMDC" Display="false" ReadOnly="True" HeaderText="Indice MDC" SortExpression="IxMDC" UniqueName="IxMDC" DataType="System.Int32" FilterControlAltText="Filter IxMDC column"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="tcar_descripcion" HeaderText="Carga" SortExpression="tcar_descripcion" UniqueName="tcar_descripcion" FilterControlAltText="Filter tcar_descripcion column" CurrentFilterFunction="Contains">
                            <HeaderStyle HorizontalAlign="Center" Font-Bold="true" Font-Size="11"></HeaderStyle>
                            <ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="DsCliente" HeaderText="Cliente" SortExpression="DsCliente" UniqueName="DsCliente" FilterControlAltText="Filter DsCliente column" CurrentFilterFunction="Contains">
                            <HeaderStyle HorizontalAlign="Center" Font-Bold="true" Font-Size="11"></HeaderStyle>
                            <ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="CantidadManifestada" HeaderText="Cantidad Manifestada" SortExpression="CantidadManifestada" UniqueName="CantidadManifestada" DataType="System.Int32" FilterControlAltText="Filter CantidadManifestada column" CurrentFilterFunction="Contains">
                            <HeaderStyle HorizontalAlign="Center" Font-Bold="true" Font-Size="11"></HeaderStyle>
                            <ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="CantidadChequeada" HeaderText="Cantidad Chequeada" SortExpression="CantidadChequeada" UniqueName="CantidadChequeada" DataType="System.Int32" FilterControlAltText="Filter CantidadChequeada column" CurrentFilterFunction="Contains">
                            <HeaderStyle HorizontalAlign="Center" Font-Bold="true" Font-Size="11"></HeaderStyle>
                            <ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </telerik:GridBoundColumn>
                        <telerik:GridButtonColumn HeaderText="Detalle" HeaderStyle-Width="70px" CommandName="detalle" Text="Ver detalle" UniqueName="Detalle" ButtonType="ImageButton" ImageUrl="/Shared/Images/detalle.png">
                            <HeaderStyle HorizontalAlign="Center" Font-Bold="true" Font-Size="11"></HeaderStyle>
                            <ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </telerik:GridButtonColumn>
                    </Columns>
                </MasterTableView>
                <HeaderContextMenu RenderMode="Auto"></HeaderContextMenu>
            </telerik:RadGrid>
            <asp:SqlDataSource runat="server" ID="sdsCargaManifestada" ConnectionString='<%$ ConnectionStrings:csOp_SPC %>' SelectCommand="SELECT ManifiestoDetalleCarga.IxMDC, op_tipocarga.tcar_descripcion, ClienteExactus.DsCliente, ManifiestoDetalleCarga.CantidadManifestada, ManifiestoDetalleCarga.CantidadChequeada FROM ManifiestoDetalleCarga INNER JOIN Escotilla ON ManifiestoDetalleCarga.IxEscotilla = Escotilla.IxEscotilla INNER JOIN ClienteExactus ON ManifiestoDetalleCarga.IdCliente = ClienteExactus.IdCliente COLLATE SQL_Latin1_General_CP1_CI_AS INNER JOIN op_tipocarga ON ManifiestoDetalleCarga.IdTipoCarga = op_tipocarga.tcar_idtipocarga WHERE (ManifiestoDetalleCarga.IdManifiesto = @IdManifiesto) AND (ManifiestoDetalleCarga.IxEscotilla = @IxEscotilla)">
                <SelectParameters>
                    <asp:ControlParameter ControlID="ddlManifiesto" PropertyName="SelectedValue" Name="IdManifiesto"></asp:ControlParameter>
                    <asp:ControlParameter ControlID="ddlEscotilla" PropertyName="SelectedValue" Name="IxEscotilla"></asp:ControlParameter>
                </SelectParameters>
            </asp:SqlDataSource>
        </telerik:RadPageView>
        <telerik:RadPageView runat="server" ID="rpvDetalleChequeo">
            <telerik:RadLabel ID="lblMensaje" runat="server" Visible="false" ForeColor="DarkBlue" Font-Bold="true" Font-Size="11"></telerik:RadLabel>
            <telerik:RadGrid ID="rgDetalleChequeo" runat="server" DataSourceID="sdsDetalleChequeo" OnItemCommand="rgDetalleChequeo_ItemCommand"
                AllowPaging="True" AllowSorting="True" AllowFilteringByColumn="True" Culture="es-ES" CssClass="RadGrid_ModernBrowsers"
                AllowAutomaticUpdates="True" FilterType="HeaderContext" EnableHeaderContextMenu="true" EnableHeaderContextFilterMenu="true" PagerStyle-AlwaysVisible="true"
                EnableLinqExpressions="False" ShowGroupPanel="True">
 
                <GroupingSettings CollapseAllTooltip="Collapse all groups" CaseSensitive="False"></GroupingSettings>
 
                <ExportSettings FileName="Detalle Chequeo" ExportOnlyData="True" HideStructureColumns="True" IgnorePaging="True" OpenInNewWindow="True">
                    <Excel Format="Xlsx" FileExtension="xlsx"></Excel>
                </ExportSettings>
 
                <ClientSettings AllowDragToGroup="True">
                    <Selecting AllowRowSelect="True"></Selecting>
                    <Resizing AllowColumnResize="true" ResizeGridOnColumnResize="false" AllowResizeToFit="true" />
                </ClientSettings>
 
                <MasterTableView DataKeyNames="IxMDCCV" DataSourceID="sdsDetalleChequeo" AutoGenerateColumns="False" CommandItemDisplay="Top" EditMode="Batch">
                    <CommandItemSettings SaveChangesText="Guardar cambios" CancelChangesText="Cancelar cambios" ShowExportToExcelButton="True" ShowAddNewRecordButton="false"></CommandItemSettings>
                    <BatchEditingSettings EditType="Row" />
                    <Columns>
                        <telerik:GridBoundColumn Display="false" DataField="IxMDCCV" ReadOnly="True" HeaderText="Indice MDCCV" SortExpression="IxMDCCV" UniqueName="IxMDCCV" DataType="System.Int32" FilterControlAltText="Filter IxMDCCV column"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Consecutivo" ReadOnly="true" HeaderText="Consecutivo" SortExpression="Consecutivo" UniqueName="Consecutivo" DataType="System.Int32" FilterControlAltText="Filter Consecutivo column" CurrentFilterFunction="Contains">
                            <HeaderStyle HorizontalAlign="Center" Font-Bold="true" Font-Size="11"></HeaderStyle>
                            <ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="FcMDCCV" ReadOnly="true" HeaderText="Fecha" SortExpression="FcMDCCV" UniqueName="FcMDCCV" DataType="System.DateTime" FilterControlAltText="Filter FcMDCCV column" CurrentFilterFunction="Contains">
                            <HeaderStyle HorizontalAlign="Center" Font-Bold="true" Font-Size="11"></HeaderStyle>
                            <ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </telerik:GridBoundColumn>
                        <telerik:GridTemplateColumn DataField="IxMV" HeaderText="Número de chasis (VIN)" SortExpression="IxMV" UniqueName="IxMV" DataType="System.Int32" FilterControlAltText="Filter IxMV column" CurrentFilterFunction="Contains">
                            <HeaderStyle HorizontalAlign="Center" Font-Bold="true" Font-Size="11"></HeaderStyle>
                            <ItemStyle HorizontalAlign="Left"></ItemStyle>
                            <EditItemTemplate>
                                <telerik:RadDropDownList ID="ddlManifiestoVehiculo" runat="server" DataValueField="IxMV" DataTextField="DsMV" DataSourceID="sdsManifiestoVehiculo"></telerik:RadDropDownList>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <%#DataBinder.Eval(Container.DataItem, "DsMV")%>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn DataField="IxChofer" HeaderText="Chofer" SortExpression="IxChofer" UniqueName="IxChofer" DataType="System.Int32" FilterControlAltText="Filter IxChofer column" CurrentFilterFunction="Contains">
                            <HeaderStyle HorizontalAlign="Center" Font-Bold="true" Font-Size="11"></HeaderStyle>
                            <ItemStyle HorizontalAlign="Left"></ItemStyle>
                            <EditItemTemplate>
                                <telerik:RadDropDownList ID="ddlChofer" runat="server" DataValueField="IxChofer" DataTextField="NumChofer" DataSourceID="sdsChofer"></telerik:RadDropDownList>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <%#DataBinder.Eval(Container.DataItem, "NumChofer")%>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridBoundColumn DataField="Observacion" HeaderText="Observación" SortExpression="Observacion" UniqueName="Observacion" FilterControlAltText="Filter Observacion column" CurrentFilterFunction="Contains">
                            <HeaderStyle HorizontalAlign="Center" Font-Bold="true" Font-Size="11"></HeaderStyle>
                            <ItemStyle HorizontalAlign="Left"></ItemStyle>
                        </telerik:GridBoundColumn>
                        <telerik:GridButtonColumn ConfirmText="¿Desea eliminar este chequeo?" ConfirmDialogType="Classic" ConfirmTitle="Eliminar" HeaderText="Eliminar" HeaderStyle-Width="70px" CommandName="eliminar" Text="Eliminar" UniqueName="Eliminar" ButtonType="ImageButton" ImageUrl="/Shared/Images/eliminar.png">
                            <HeaderStyle HorizontalAlign="Center" Font-Bold="true" Font-Size="11"></HeaderStyle>
                            <ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </telerik:GridButtonColumn>
                    </Columns>
                </MasterTableView>
                <HeaderContextMenu RenderMode="Auto"></HeaderContextMenu>
            </telerik:RadGrid>
            <asp:SqlDataSource runat="server" ID="sdsDetalleChequeo" ConnectionString='<%$ ConnectionStrings:csOp_SPC %>' SelectCommand="SELECT MDCControlV.IxMDCCV, MDCControlV.Consecutivo, MDCControlV.FcMDCCV, MDCControlV.IxMV, MDCControlV.IxChofer, MDCControlV.Observacion, ManifiestoVehiculo.DsMV, CONCAT(MVChofer.NumeroChofer, ' - ', MVChofer.Nombre) AS NumChofer FROM MDCControlV WITH (NOLOCK) INNER JOIN MVChofer WITH (NOLOCK) ON MDCControlV.IxChofer = MVChofer.IxChofer INNER JOIN ManifiestoVehiculo ON MDCControlV.IxMV = ManifiestoVehiculo.IxMV WHERE (MDCControlV.IxMDC = @IxMDC)" UpdateCommand="UPDATE MDCControlV SET IxMV = @IxMV, IxChofer = @IxChofer, Observacion = @Observacion WHERE (IxMDCCV = @IxMDCCV)">
                <SelectParameters>
                    <asp:Parameter Name="IxMDC"></asp:Parameter>
                </SelectParameters>
                <UpdateParameters>
                    <asp:Parameter Name="IxMV"></asp:Parameter>
                    <asp:Parameter Name="IxChofer"></asp:Parameter>
                    <asp:Parameter Name="Observacion"></asp:Parameter>
                    <asp:Parameter Name="IxMDCCV"></asp:Parameter>
                </UpdateParameters>
            </asp:SqlDataSource>
            <asp:SqlDataSource runat="server" ID="sdsChofer" ConnectionString='<%$ ConnectionStrings:csOp_SPC %>' SelectCommand="SELECT CONCAT(NumeroChofer, ' - ', Nombre) AS NumChofer, IxChofer FROM MVChofer WITH(NOLOCK) ORDER BY NumeroChofer"></asp:SqlDataSource>
            <asp:SqlDataSource runat="server" ID="sdsManifiestoVehiculo" ConnectionString='<%$ ConnectionStrings:csOp_SPC %>' SelectCommand="SELECT IxMV, DsMV FROM ManifiestoVehiculo WITH (NOLOCK) WHERE (IdManifiesto = @IdManifiesto) AND (IxMV NOT IN (SELECT MDCControlV.IxMV FROM MDCControlV WITH (NOLOCK) INNER JOIN ManifiestoDetalleCarga WITH (NOLOCK) ON MDCControlV.IxMDC = ManifiestoDetalleCarga.IxMDC WHERE (ManifiestoDetalleCarga.IdManifiesto = @IdManifiesto) AND (MDCControlV.IxMV IS NOT NULL)))">
                <SelectParameters>
                    <asp:ControlParameter ControlID="ddlManifiesto" PropertyName="SelectedValue" Name="IdManifiesto"></asp:ControlParameter>
                </SelectParameters>
            </asp:SqlDataSource>
        </telerik:RadPageView>
    </telerik:RadMultiPage>

2 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 25 Oct 2018, 03:02 PM
Hi Carlos,

Controls that are in another naming container or in a data bound control cannot be added like that to the settings, because the server code cannot reach them, because they do not exist in the current context. 

From what I can see, I would guess that you need to add the "rgDetalleChequeo" grid as an updated control for the "ddlManifiesto" setting, so that it gets updated and changes you make to the dropdown in the template will be carried to the client.


Regards,
Marin Bratanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Carlos
Top achievements
Rank 1
answered on 25 Oct 2018, 05:24 PM
Hello Marin, now I understand what is happening in the current context.
Thank you so much. Pura vida!!
Tags
Ajax
Asked by
Carlos
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Carlos
Top achievements
Rank 1
Share this question
or