Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
67 views

Hello.  I have a modal popup RadWindow being used as an edit form. This RadWindow is launched from a row in a RadGrid. Everything works great, except when the user finishes with the RadWindow and it closes, the calling RadGrid successfully does a rebind, but it doesn't visually update on the screen. The auto-refreshing the RadGrid works great for other uses such as deleting a record, or updating a record, but not when the rebind code runs upon returning from the modal RadWindow.  When the radwindow closes, it triggers the RadAjaxManager1_AjaxRequest which does the rebind operation. That runs just fine. The only thing not happening is the rendering of the screen so the user sees the updated data in the radgrid.  

Anyone have any ideas why this would be happening or way to force the re-rendering of the screen/radgrid?

This is the script on the source page:

        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
            <script type="text/javascript">
                function refreshGrid(arg) {
                    if (!arg) {
                        $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
                    }
                    else {
                        $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("RebindAndNavigate");
                    }
                }
            </script>
        </telerik:RadCodeBlock>

This gets calls when the popup closes:

    Protected Sub RadAjaxManager1_AjaxRequest(ByVal sender As Object, ByVal e As AjaxRequestEventArgs) Handles RadAjaxManager1.AjaxRequest
        If e.Argument = "Rebind" Then
            rgVehicleConfig.DataSource = Nothing
            rgVehicleConfig.Rebind()
        End If
    End Sub

This is the script on the popup aspx page:

    <script type="text/javascript">
        function CloseAndRebind(args)
        {
            GetRadWindow().BrowserWindow.refreshGrid(args);
            GetRadWindow().close();
            document.getElementById("frmSequencingAreas").submit();
        }

        function Close(args)
        {
            GetRadWindow().close();
        }

        function GetRadWindow()
        {
            var oWindow = null;
            if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog
            else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz as well)

            return oWindow;
        }
    </script>

Finally, this is the code for the final import of the data that closes the RadWindow and returns to the calling page:

    Private Sub rgVehicleConfiguration_ItemCommand(sender As Object, e As GridCommandEventArgs) Handles rgVehicleConfiguration.ItemCommand
        If e.CommandName = "Export" Then
            If ErrorsFound Then
                lblMessage.Text = "Highlighted values are invalid. Please correct and try importing file again.</br>Data cannot be imported until all errors are corrected."
            Else
                ExportData()
                ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "CloseAndRebind();", True)
                ShowPopup = False
            End If
        End If
    End Sub

Most of this code was lifted from Telerik's own demo and that seems to work just fine here on the Telerik demo site.

Any help would be wonderful.

Thank you.

 

Sean
Top achievements
Rank 1
 updated question on 24 Oct 2023
0 answers
110 views

Hi,

i open a radwindow fro ma button inside a templatecolumn in a detailtable.

In the radwindow i have a radbutton when i click it the OnClick event doesn't fire.

Here the code.

 

<%@ Page Title="" Language="C#" MasterPageFile="~/SiteT.Master" AutoEventWireup="true" CodeBehind="AnalisiExc.aspx.cs" Inherits="IPadAdmin.AnalisiExc" %>

<asp:Content ID="Content1" ContentPlaceHolderID="StyleSection" runat="server">
    <style>
        .RadGrid {
            border-radius: 10px;
            overflow: hidden;
        }

        th {
            font-size: 14px;
        }

        td {
            font-size: 13px;
        }
    </style>
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            var radWindow1 = null;
            var radGrid1 = null;

            function pageLoad() {
                radGrid1 = $find("<%= RadGrid1.ClientID %>");
                radWindow1 = $find("<%= RadWindow1.ClientID %>");
            }
        </script>
    </telerik:RadCodeBlock>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentSection" runat="server">
    <form id="form1" runat="server" onsubmit="return validateForm()">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
        <div class="row page-titles">
            <div class="col-md-5 align-self-center">
                <telerik:RadCodeBlock runat="server">
                    <h3 class="text-primary"><a href="<%=Page.ResolveUrl("~/Default.aspx") %>">Dashboard</a></h3>
                </telerik:RadCodeBlock>
            </div>
            <div class="col-md-7 align-self-center">
                <ol class="breadcrumb">
                    <li class="breadcrumb-item">Amministrazione</li>
                    <li class="breadcrumb-item">Analisi</li>
                    <li class="breadcrumb-item">Eccezioni</li>
                </ol>
            </div>
        </div>
        <div class="container-fluid">
            <div class="row">
                <div class="col-12">
                    <div class="card">
                        <div class="card-body">
                            <div class="table-responsive m-t-40">
                                <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" UpdateInitiatorPanelsOnly="true">
                                    <AjaxSettings>
                                        <telerik:AjaxSetting AjaxControlID="RadGrid1">
                                            <UpdatedControls>
                                                <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                                            </UpdatedControls>
                                        </telerik:AjaxSetting>
                                        <telerik:AjaxSetting AjaxControlID="Button1">
                                            <UpdatedControls>
                                                <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                                            </UpdatedControls>
                                        </telerik:AjaxSetting>
                                    </AjaxSettings>
                                </telerik:RadAjaxManager>
                                <telerik:RadFormDecorator RenderMode="Lightweight" ID="RadFormDecorator1" runat="server" DecorationZoneID="demo" DecoratedControls="All" EnableRoundedCorners="false" />
                                <telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanel1" />
                                <asp:LinkButton ID="Button1"
                                    runat="server"
                                    CssClass="btn btn-primary btn-rounded m-b-10 m-l-5"
                                    Text="AGGIORNA"
                                    OnClick="Button1_Click">
                                </asp:LinkButton>
                                <div class="form-inline">
                                    <label class="control-label">&nbsp;Anno&nbsp;</label>
                                    <telerik:RadNumericTextBox runat="server" ID="txtAnno" NumberFormat-DecimalDigits="0" NumberFormat-GroupSeparator="" Width="100px" />
                                    <label class="control-label">&nbsp;Mese&nbsp;</label>
                                    <telerik:RadComboBox ID="cmbMese" runat="server" AutoPostBack="false" TabIndex="6" AppendDataBoundItems="true">
                                        <Items>
                                            <telerik:RadComboBoxItem runat="server" Value="0" Text="(Seleziona un mese)" />
                                            <telerik:RadComboBoxItem runat="server" Value="1" Text="Gennaio" />
                                            <telerik:RadComboBoxItem runat="server" Value="2" Text="Febbraio" />
                                            <telerik:RadComboBoxItem runat="server" Value="3" Text="Marzo" />
                                            <telerik:RadComboBoxItem runat="server" Value="4" Text="Aprile" />
                                            <telerik:RadComboBoxItem runat="server" Value="5" Text="Maggio" />
                                            <telerik:RadComboBoxItem runat="server" Value="6" Text="Giugno" />
                                            <telerik:RadComboBoxItem runat="server" Value="7" Text="Luglio" />
                                            <telerik:RadComboBoxItem runat="server" Value="8" Text="Agosto" />
                                            <telerik:RadComboBoxItem runat="server" Value="9" Text="Settembre" />
                                            <telerik:RadComboBoxItem runat="server" Value="10" Text="Ottobre" />
                                            <telerik:RadComboBoxItem runat="server" Value="11" Text="Novembre" />
                                            <telerik:RadComboBoxItem runat="server" Value="12" Text="Dicembre" />
                                        </Items>
                                    </telerik:RadComboBox>
                                </div>
                                <br />
                                <div>
                                    <telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True" AllowSorting="true" EnableLoadOnDemand="True" ShowGroupPanel="true" OnNeedDataSource="RadGrid1_NeedDataSource"
                                        AutoGenerateColumns="False" AllowPaging="False" PageSize="50" Skin="Material" OnItemCommand="RadGrid1_ItemCommand" OnGroupsChanging="RadGrid1_GroupsChanging" OnDetailTableDataBind="RadGrid1_DetailTableDataBind"
                                        OnItemDataBound="RadGrid1_ItemDataBound" OnCustomAggregate="RadGrid1_CustomAggregate"
                                        RenderMode="Lightweight" ShowFooter="True" ShowStatusBar="True" Culture="it-IT" GridLines="None" Width="100%">
                                        <PagerStyle Mode="NumericPages"></PagerStyle>
                                        <GroupingSettings CaseSensitive="false" />
                                        <MasterTableView DataKeyNames="AG,SlpCode,Mese" AllowMultiColumnSorting="False" GroupLoadMode="Client" HierarchyLoadMode="Client"
                                            CommandItemDisplay="Top" ShowGroupFooter="true" EnableHierarchyExpandAll="true" Caption="" TableLayout="Fixed">
                                            <CommandItemSettings ShowAddNewRecordButton="false" ShowSaveChangesButton="false" ShowCancelChangesButton="false" ShowExportToExcelButton="true" />
                                            <GroupByExpressions>
                                                <telerik:GridGroupByExpression>
                                                    <SelectFields>
                                                        <telerik:GridGroupByField FieldAlias="Limite" FieldName="Limite" />
                                                        <telerik:GridGroupByField FieldAlias="Valid" FieldName="Valid" />
                                                        <telerik:GridGroupByField FieldAlias="AG" FieldName="AG" />
                                                    </SelectFields>
                                                    <GroupByFields>
                                                        <%--<telerik:GridGroupByField FieldName="CA" SortOrder="Ascending"></telerik:GridGroupByField>--%>
                                                        <telerik:GridGroupByField FieldName="AG" SortOrder="Ascending"></telerik:GridGroupByField>
                                                        <%--<telerik:GridGroupByField FieldName="Mese" SortOrder="Ascending"></telerik:GridGroupByField>--%>
                                                    </GroupByFields>
                                                </telerik:GridGroupByExpression>
                                            </GroupByExpressions>
                                            <DetailTables>
                                                <telerik:GridTableView runat="server" AllowFilteringByColumn="False" AllowSorting="False" AllowAutomaticUpdates="false"
                                                    AutoGenerateColumns="False" AllowPaging="false" DataKeyNames="DocEntry" Caption="" Skin="Material"
                                                    RenderMode="Lightweight" ShowFooter="False" ShowStatusBar="True" CellSpacing="0" Name="Rate">
                                                    <Columns>
                                                        <telerik:GridBoundColumn DataField="DocEntry" HeaderText="" ReadOnly="True" Visible="false" UniqueName="DocEntry" />
                                                        <telerik:GridBoundColumn DataField="Aut" HeaderText="" ReadOnly="True" Visible="false" UniqueName="AutV" />
                                                        <telerik:GridBoundColumn DataField="Dec" HeaderText="" ReadOnly="True" Visible="false" UniqueName="Dec" />
                                                        <telerik:GridDateTimeColumn DataField="Data" HeaderText="Data" SortExpression="DocDate" ReadOnly="False" DataType="System.DateTime" DataFormatString="{0:D}"
                                                            UniqueName="Data">
                                                        </telerik:GridDateTimeColumn>
                                                        <telerik:GridBoundColumn DataField="DocNum" HeaderText="#" SortExpression="DocNum" ReadOnly="True" Visible="True"
                                                            UniqueName="DocNum">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="CardCode" HeaderText="Codice" SortExpression="CardCode" ReadOnly="True" Visible="True"
                                                            UniqueName="CardCode">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="CardName" HeaderText="Rag. Sociale" SortExpression="CardName" ReadOnly="True"
                                                            UniqueName="CardName">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="Pagamento" HeaderText="Pagamento" SortExpression="Pagamento" ReadOnly="True"
                                                            UniqueName="Pagamento">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="Netto" HeaderText="Netto" SortExpression="Netto" DataFormatString="{0:N2}" AllowFiltering="false" ItemStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Right"
                                                            UniqueName="Netto">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="RatDoc" HeaderText="RatDoc" SortExpression="RatDoc" ReadOnly="True"
                                                            UniqueName="RatDoc">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="RatBp" HeaderText="RatBp" SortExpression="RatBp" ReadOnly="True"
                                                            UniqueName="RatBp">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridTemplateColumn HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="center" HeaderText="Aut." AllowFiltering="false" UniqueName="Aut">
                                                            <ItemTemplate>
                                                                <telerik:RadCheckBox ID="chkAut" runat="server" Checked='<%# Bind("Aut") %>' OnCheckedChanged="chkAut_CheckedChanged" />
                                                            </ItemTemplate>
                                                        </telerik:GridTemplateColumn>
                                                        <telerik:GridTemplateColumn HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="center" HeaderText="Dec." AllowFiltering="false" UniqueName="Dec">
                                                            <ItemTemplate>
                                                                <telerik:RadCheckBox ID="chDec" runat="server" Checked='<%# Bind("Dec") %>' OnCheckedChanged="chDec_CheckedChanged" />
                                                            </ItemTemplate>
                                                        </telerik:GridTemplateColumn>
                                                        <telerik:GridTemplateColumn HeaderText=""
                                                            AllowFiltering="false">
                                                            <HeaderStyle Width="102px" />
                                                            <ItemTemplate>
                                                                <asp:LinkButton ID="cmdNota" runat="server" Text="NOTA" OnClientClick='<%# String.Format("openConfirmationWindow({0}); return false;", Eval("DocEntry")) %>'
                                                                    CssClass="bookNowLink" />
                                                            </ItemTemplate>
                                                        </telerik:GridTemplateColumn>
                                                    </Columns>
                                                </telerik:GridTableView>
                                            </DetailTables>
                                            <Columns>
                                                <%--<telerik:GridBoundColumn DataField="CA" HeaderText="AREA" SortExpression="AREA" ReadOnly="True" UniqueName="CA" />--%>
                                                <telerik:GridBoundColumn DataField="AG" HeaderText="AG" SortExpression="AG" ReadOnly="True" UniqueName="AG" />
                                                <telerik:GridBoundColumn DataField="SlpCode" HeaderText="Codice" ReadOnly="True" UniqueName="SlpCode" />
                                                <telerik:GridBoundColumn DataField="AGE" HeaderText="Agente" SortExpression="AGE" ReadOnly="True" UniqueName="AGE" />
                                                <telerik:GridBoundColumn DataField="Anno" HeaderText="Anno" ReadOnly="True" UniqueName="Anno" AllowFiltering="false" />
                                                <telerik:GridBoundColumn DataField="Mese" HeaderText="Mese" SortExpression="Mese" ReadOnly="True" AllowFiltering="false" UniqueName="Mese" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" />
                                                <telerik:GridBoundColumn DataField="Numero" HeaderText="Totali" SortExpression="Numero" ReadOnly="True" Groupable="false" UniqueName="Numero" Aggregate="Sum" FooterText="Totali: " FooterStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" AllowFiltering="false" />
                                                <telerik:GridBoundColumn DataField="Valore" HeaderText="Valore" SortExpression="Valore" DataFormatString="{0:N2}" AllowFiltering="false" ItemStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Right"
                                                    UniqueName="Valore" FooterText="Tot: " Aggregate="Sum" FooterStyle-HorizontalAlign="Right" Groupable="false">
                                                </telerik:GridBoundColumn>
                                                <telerik:GridBoundColumn DataField="Limite" HeaderText="Limite" SortExpression="" ReadOnly="True" UniqueName="Limite" AllowFiltering="false" />
                                                <telerik:GridBoundColumn DataField="Valid" HeaderText="" SortExpression="" ReadOnly="True" UniqueName="Valid" Display="false" />
                                                <telerik:GridTemplateColumn HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="center" HeaderText="Term"
                                                    AllowFiltering="false" UniqueName="Term" Groupable="false">
                                                    <ItemTemplate>
                                                        <telerik:RadCheckBox ID="chkTerm" runat="server" Checked='<%# Bind("Term") %>' OnCheckedChanged="chkTerm_CheckedChanged" />
                                                    </ItemTemplate>
                                                </telerik:GridTemplateColumn>
                                            </Columns>
                                        </MasterTableView>
                                        <ClientSettings ReorderColumnsOnClient="True" AllowDragToGroup="True" AllowColumnsReorder="True">
                                            <Selecting AllowRowSelect="True"></Selecting>
                                            <Resizing AllowRowResize="True" AllowColumnResize="True" EnableRealTimeResize="True"
                                                ResizeGridOnColumnResize="False"></Resizing>
                                        </ClientSettings>
                                        <FilterMenu RenderMode="Lightweight"></FilterMenu>
                                        <HeaderContextMenu RenderMode="Lightweight"></HeaderContextMenu>
                                        <GroupingSettings ShowUnGroupButton="true"></GroupingSettings>
                                    </telerik:RadGrid>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <telerik:RadWindowManager RenderMode="Lightweight" ID="RadWindowManager1" ShowContentDuringLoad="false" VisibleStatusbar="true"
            ReloadOnShow="true" runat="server" EnableShadow="true">
            <Windows>
                <telerik:RadWindow RenderMode="Lightweight" ID="RadWindow1" runat="server" VisibleTitlebar="true" Modal="true" Width="500px" Height="300px"
                    Behaviors="None" VisibleStatusbar="false">
                    <ContentTemplate>
                        <asp:Panel ID="FirstStepPanel" runat="server">
                            <div>
                                <asp:HiddenField ID="DocEntry" ClientIDMode="Static" runat="server" />
                                <hr class="lineSeparator" style="margin: 12px 0 12px 0" />
                                <table width="99%">
                                    <tr>
                                        <td>
                                            <telerik:RadTextBox ID="txtNota" runat="server" TextMode="MultiLine" Rows="6" MaxLength="250" Width="99%"></telerik:RadTextBox>
                                        </td>
                                    </tr>
                                </table>
                                <hr class="lineSeparator" style="margin: 12px 0 15px 0" />
                                <telerik:RadButton RenderMode="Lightweight" ID="cmdApprova" runat="server" Text="INSERISCI" CausesValidation="false" OnClientClicking="RadConfirm"
                                    Width="120px" OnClick="cmdApprova_Click" UseSubmitBehavior="false" />
                                <telerik:RadButton RenderMode="Lightweight" ID="cmdAnnulla" runat="server" Text="ANNULLA"
                                    Width="120px" OnClientClicking="cancelClicking" UseSubmitBehavior="false" />
                            </div>
                        </asp:Panel>
                    </ContentTemplate>
                </telerik:RadWindow>
            </Windows>
        </telerik:RadWindowManager>
    </form>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ScriptSection" runat="server">
    <script>
        function validateForm() {
            var errors = false;
            var testo = document.getElementById('<%= txtAnno.ClientID %>');
            if (testo.value == '') {
                errors = true;
                alert('Inserire un anno la ricerca.');
            } else {
                errors = false;
            }
            if (errors == false) {
                document.getElementById("form1").submit();
            }
        }
        function openConfirmationWindow(val) {
            var radtextbox = $find('<%=txtNota.ClientID %>');
            radtextbox.clear();
            document.getElementById("DocEntry").value = val;
            radWindow1.set_title('Nota');
            radWindow1.show();
        }
        function RadConfirm(sender, args) {
            var callBackFunction = function (shouldSubmit) {
                if (shouldSubmit) {
                    sender.click();
                    if (Telerik.Web.Browser.ff) {
                        sender.get_element().click();
                    }
                }
            };

            var text = "Proseguire con l'\operazione?";
            radconfirm(text, callBackFunction, 300, 200, null, "RadConfirm");
            args.set_cancel(true);
        }
        function cancelClicking(sender, args) {
            radWindow1.close();
            args.set_cancel(true);
        }
        function AlertInvia(sender, args) {
            args.set_cancel(!window.confirm("Proseguire con l\'operazione?"));
        }
    </script>
</asp:Content>
IT
Top achievements
Rank 1
 asked on 30 Aug 2023
0 answers
60 views

Dear Telerik Team,

We have purchased Telerik UI for ASP.NET AJAX UI 2010.1519. Now we are facing vulnerable issues as it is using jQuery 1.4.2.

One of the Telerik doc tells that

When Telerik upgraded jQuery version to 3.3.1, it faces incompatibilities with the MS AJAX framework and its __doPostBack() method. Due to which, Telerik downgraded jQuery version Telerik UI for ASP.NET AJAX R1 2019 - present are using a modified jQuery version 1.12.4 that includes security vulnerability backport fixes.

Is there a fix to overcome this issue other than upgrading the Telerik version to 2019 or greater?

1 answer
123 views
Helllo, I would like the radwindow to stay on top of the form when selecting the "Select" button inside the combobox. The Select button does some server side work. The Reprocess button it will also do server side work. The only time the radwindow will close is when pressing the Close button.   For the 'Select' Button I could replace the code with javascript but I'm not sure how to go about it.  Below is my sample code 
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Linq.aspx.vb" Inherits="CreatePAth.Linq" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            function stopPostBack() {
                return true;
            }


            function openAssayErrors() {
                var wnd = $find("<%=winAssayErrors.ClientID%>");
                wnd.show();
                return false;
            }
            function closeAssayErrors() {
                var wnd = $find("<%=winAssayErrors.ClientID%>");
                wnd.close();
                return false;
            }

            function RefreshParentPage() {
                document.location.reload();
            }
            function stopPostback() {
                return true;
            }
        </script>
    </telerik:RadCodeBlock>

</head>
<body>
    <form id="form1" runat="server">
        <div>
            <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">

                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="btnCloseWinx">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="btnSelectComment">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="btnSelectComment" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="bAssayErrors">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="bAssayErrors" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
            </telerik:RadAjaxManager>
            <telerik:RadGrid ID="RadGrid1" AllowAutomaticUpdates="True"
                RenderMode="Lightweight" runat="server" AllowSorting="True" ShowStatusBar="true" AutoGenerateColumns="False"
                EnableHeaderContextMenu="True"
                Height="220"
                ViewStateMode="Enabled"
                EnableViewState="true">
                <ClientSettings>
                    <Scrolling AllowScroll="true" FrozenColumnsCount="14" SaveScrollPosition="true" UseStaticHeaders="true" />
                </ClientSettings>
                <MasterTableView HeaderStyle-ForeColor="White" EnableColumnsViewState="false" AllowAutomaticUpdates="true" AllowSorting="True" EnableLinqGrouping="False" GroupsDefaultExpanded="False" Width="100%" TableLayout="fixed" DataKeyNames="Item, ErrorSamples">
                    <Columns>
                        <telerik:GridBoundColumn DataField="Item" FilterControlAltText="Item" HeaderText="Item" UniqueName="Item" AllowFiltering="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridTemplateColumn HeaderStyle-Width="150px" HeaderText="Error Samples" DataField="ErrorSamples" UniqueName="ErrorSamples">
                            <ItemTemplate>
                                <telerik:RadButton ID="bAssayErrors" ButtonType="LinkButton" Width="80px" AutoPostBack="true" OnClientClicked="openAssayErrors" CommandName="SelectAssayErrors" runat="server" Text='<%# Eval("ErrorSamples") %>'></telerik:RadButton>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>

            <div>
                <asp:Label ID="lblmessage" runat="server" Text=""></asp:Label>
            </div>
            <telerik:RadWindow ID="winAssayErrors" runat="server" Modal="true" VisibleTitlebar="True" VisibleStatusbar="false"
                ReloadOnShow="true"
                ShowContentDuringLoad="false"
                Width="950px" Height="500px"
                Title="List by Assay" Style="z-index: 100001;">
                <ContentTemplate>
                    <div>
                        <table>
                            <tr>
                                <td>
                                    <asp:Label ID="lblAssayName" runat="server" Text=""></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <telerik:RadGrid ID="rgAssays" AllowAutomaticUpdates="True"
                                        RenderMode="Lightweight" Skin="Default" runat="server" AllowSorting="True" ShowStatusBar="true" AutoGenerateColumns="False" OnItemDataBound="rgAssays_ItemDataBound" OnItemCommand="rgAssays_ItemCommand"
                                        EnableHeaderContextMenu="True"
                                        Height="220px"
                                        Width="900px"
                                        ViewStateMode="Enabled"
                                        EnableViewState="true">
                                        <ClientSettings>
                                            <Scrolling AllowScroll="true" FrozenColumnsCount="14" SaveScrollPosition="true" UseStaticHeaders="true" />
                                        </ClientSettings>
                                        <MasterTableView HeaderStyle-BackColor="" EnableColumnsViewState="false" AllowAutomaticUpdates="true"
                                            AllowSorting="True" EnableLinqGrouping="False" GroupsDefaultExpanded="False" Width="100%" TableLayout="fixed" ShowFooter="true"
                                            DataKeyNames="AssayName,  NoSamples, OKSamples">
                                            <Columns>
                                                <telerik:GridBoundColumn DataField="AssayName" FilterControlAltText="AssayID" HeaderText="AssayName" UniqueName="AssayName" AllowFiltering="false">
                                                </telerik:GridBoundColumn>
                                                <telerik:GridBoundColumn DataField="NoSamples" FilterControlAltText="NoSamples" Display="true" HeaderText="# Samples" UniqueName="NoSamples" AllowFiltering="false">
                                                </telerik:GridBoundColumn>
                                                <telerik:GridBoundColumn DataField="OKSamples" FilterControlAltText="OKSamples" HeaderText="Ok Samples" UniqueName="OKSamples" ReadOnly="true">
                                                </telerik:GridBoundColumn>
                                                <telerik:GridBoundColumn DataField="Comments" FilterControlAltText="Comments" HeaderText="Comments" UniqueName="Comments" ReadOnly="true">
                                                </telerik:GridBoundColumn>

                                                <telerik:GridTemplateColumn HeaderStyle-Width="150px" HeaderText="Reprocess" DataField="Reprocess" UniqueName="Reprocess">
                                                    <ItemTemplate>
                                                        <telerik:RadCheckBox ID="chkReprocess" AutoPostBack="false" Width="80px" runat="server"></telerik:RadCheckBox>
                                                    </ItemTemplate>
                                                </telerik:GridTemplateColumn>
                                                <telerik:GridTemplateColumn HeaderStyle-Width="250px" HeaderText="RPNote" DataField="RPNote" UniqueName="RPNote">
                                                    <ItemTemplate>
                                                        <telerik:RadComboBox runat="server" ID="cbRPNote" Height="300px" Width="100px "
                                                            DropDownWidth="500"
                                                            ViewStateMode="Enabled"
                                                            MarkFirstMatch="true"
                                                            HighlightTemplatedItems="True"
                                                            EmptyMessage="select"
                                                            CheckBoxes="false"
                                                            AllowCustomText="false"
                                                            Style="z-index: 200001;">
                                                            <HeaderTemplate>
                                                                <table style="width: 500px; text-align: left">
                                                                    <tr>
                                                                        <td style="width: 50px;">ID</td>
                                                                        <td style="width: 200px;">Spec. Comments</td>
                                                                        <td style="width: 200px;">User Comments</td>
                                                                        <td style="width: 80px;"></td>
                                                                    </tr>
                                                                </table>
                                                            </HeaderTemplate>
                                                            <ItemTemplate>
                                                                <table style="width: 550px; text-align: left; float: right;">
                                                                    <tr>
                                                                        <td style="width: 50px;">
                                                                            <asp:Label ID="Rejection_ID" runat="server" Text='<%# Eval("Rejection_ID") %>'></asp:Label>
                                                                        </td>
                                                                        <td style="width: 200px;">
                                                                            <asp:Label ID="Txt_Description" runat="server" Text='<%# Eval("Txt_Description") %>'></asp:Label>
                                                                        </td>
                                                                        <td style="width: 200px;">
                                                                            <asp:TextBox ID="txt_RPNote" runat="server" Text=""></asp:TextBox>
                                                                        </td>
                                                                        <td style="width: 80px;">
                                                                            <telerik:RadButton ID="btnSelectComment" OnClick="btnSelectComment_Click" runat="server" Text="Select"></telerik:RadButton>
                                                                        </td>
                                                                    </tr>
                                                                </table>
                                                            </ItemTemplate>
                                                        </telerik:RadComboBox>
                                                    </ItemTemplate>
                                                    <FooterTemplate>
                                                        <asp:Label ID="Label1" runat="server" Text=" Do Server stuff and return.... "></asp:Label>
                                                        <telerik:RadButton ID="imRP" runat="server" Text="Reprocess" OnClick="imRP_Click" CommandName="Reprocess"></telerik:RadButton>
                                                        <telerik:RadButton ID="btnCloseWinx" runat="server" Text="Close"></telerik:RadButton>

                                                    </FooterTemplate>
                                                </telerik:GridTemplateColumn>
                                            </Columns>
                                        </MasterTableView>
                                    </telerik:RadGrid>
                                </td>
                            </tr>
                        </table>
                    </div>
                </ContentTemplate>
            </telerik:RadWindow>

        </div>
    </form>
</body>
</html>



Imports Telerik.Web.UI

Public Class Linq
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Page.IsPostBack = False Then
            Dim AssysGroup = New List(Of Assays) _
        From {New Assays With {.AssayName = "C6", .NoSamples = "12", .OKSamples = "1", .Comments = "OK", .Reprocess = True},
                New Assays With {.AssayName = "Crtert", .NoSamples = "5", .OKSamples = "2", .Comments = "OK", .Reprocess = False},
                New Assays With {.AssayName = "POWEB", .NoSamples = "2", .OKSamples = "1", .Comments = "OK", .Reprocess = False},
                New Assays With {.AssayName = "POWELISA", .NoSamples = "4", .OKSamples = "0", .Comments = "fds", .Reprocess = False},
                New Assays With {.AssayName = "CTT", .NoSamples = "3", .OKSamples = "0", .Comments = "", .Reprocess = False},
                New Assays With {.AssayName = "POWEA", .NoSamples = "5", .OKSamples = "1", .Comments = "", .Reprocess = False}}
            rgAssays.DataSource = AssysGroup
            rgAssays.DataBind()

            Dim MainGrid = New List(Of sItems) _
             From {New sItems With {.Item = "AAA", .ErrorSamples = 10},
                New sItems With {.Item = "BBB", .ErrorSamples = 12},
                New sItems With {.Item = "CCC", .ErrorSamples = 0},
                New sItems With {.Item = "DDD", .ErrorSamples = 0}}
            RadGrid1.DataSource = MainGrid
            RadGrid1.DataBind()
        End If

    End Sub

    Private Class Assays
        Property AssayID As String
        Property AssayName As String
        Property NoSamples As String
        Property OKSamples As String
        Property Comments As String
        Property Reprocess As Boolean


    End Class


    Private Class sItems
        Property Item As String
        Property ErrorSamples As String

    End Class

    Protected Sub rgAssays_ItemDataBound(sender As Object, e As Telerik.Web.UI.GridItemEventArgs)
        If TypeOf e.Item Is GridDataItem Then
            Dim gridItem As GridDataItem = TryCast(e.Item, GridDataItem)
            Dim dt As DataTable = New DataTable()
            Dim combo As RadComboBox
            combo = gridItem.FindControl("cbRPNote")
            dt.Columns.Add("Rejection_ID", GetType(Integer))
            dt.Columns.Add("Txt_Description", GetType(String))
            dt.Columns.Add("txt_RPNote", GetType(String))
            dt.Rows.Add(1, "Not enough solution", "")
            dt.Rows.Add(2, "Positve Result", "")
            dt.Rows.Add(3, "Damage Specimen", "")
            dt.Rows.Add(4, "Equipment failute", "")
            dt.Rows.Add(5, "User mistake", "")
            combo.DataTextField = "Txt_Description"
            combo.DataValueField = "Rejection_ID"
            combo.DataSource = dt
            combo.DataBind()
        End If
    End Sub

    Protected Sub rgRPNote_SelectedIndexChanged(sender As Object, e As RadComboBoxSelectedIndexChangedEventArgs)
        Dim val As String = e.Text
    End Sub

    Protected Sub btnSelectComment_Click(sender As Object, e As EventArgs)
        Dim button As RadButton = CType(sender, RadButton)
        Dim s As String = CType(button.NamingContainer.FindControl("Txt_Description"), Label).Text
        Dim s1 As String = CType(button.NamingContainer.FindControl("txt_RPNote"), TextBox).Text
        CType(button.NamingContainer.Parent, RadComboBox).Text = s1
    End Sub


    Protected Sub imRP_Click(sender As Object, e As EventArgs)
        For Each item As GridDataItem In rgAssays.Items
            Dim chkRP As RadCheckBox = CType(item.FindControl("chkReprocess"), RadCheckBox)
            If chkRP.Checked = False Then
                lblmessage.Text = "Please Enter an RPNote for Items to be reprocess"
                lblmessage.Focus()
                Exit Sub
            End If
            If CType(item.FindControl("cbRPNote"), RadComboBox).Text.Length > 0 Then
                Dim s As String = "yea doing long background work"
            End If
        Next
    End Sub


End Class

Doncho
Telerik team
 answered on 20 Oct 2022
0 answers
84 views


    function PendingRowSelected(row) {
         var guid = $find("<%=PendingRadGrid.ClientID%>").get_masterTableView().get_selectedItems()[0].getDataKeyValue("Guid");
        var radWindow = Quest.Utilities.WindowUtil.openRADWindow("PendingEditWindow", "Portlets/ConnectData/PendingEdit.aspx?id=" +guid);                          //radWindow value as undefined
        radWindow.Restore();
        var close = document.getElementById("CloseButton" + radWindow.Id);
        close.onclick = CloseRadWindow;
    }

 

Can anyone please help to resolve?

Sachita
Top achievements
Rank 1
Iron
Iron
Iron
 asked on 08 Feb 2022
0 answers
18 views

When I installed the old offline package (TelerikUIForWinFormsSetup.exe), it showed "Internet Connective Failure" error. Please check the attached screenshot.  Would you please help me? Thanks.


Steven
Top achievements
Rank 1
 asked on 06 Jan 2022
1 answer
80 views

Hello!

I am attempting to send the an ID value from one RadGrid Row to a RadGrid in a modal window as a DataKey using rowIndex. 

I sucessfully get the cell value but right now it is just sending it to OwnerTableView rather than my modal window grid.

aspx.cs code:

protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridDataItem)
        {
            RadButton partsBtn = (RadButton)e.Item.FindControl("RadButton1");
            partsBtn.Attributes["href"] = "javascript:void(0);";
            Console.WriteLine(e.Item.ItemIndex);
            partsBtn.Attributes["onclick"] = String.Format("return ShowEditForm('{0}','{1}');", e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["OrderID"], e.Item.ItemIndex);
        }
    }

 

I only want the modal Grid to populate with values that also have that ID (multiple values).

Any thoughts on this?

Attila Antal
Telerik team
 answered on 03 Jan 2022
0 answers
61 views

Hello.

I'm using CommandItem built in Insert button to open a window with a form to insert new values.


      <telerik:RadWindow ID="UserListDialog" runat="server" Title="Atualizar listagem" Height="400px" OnClientClose="OnClientCloseHandler" 
                            Width="800px" Left="150px" ReloadOnShow="true" ShowContentDuringLoad="false" DestroyOnClose="true"
                            Modal="true" 
                            Behaviors="Close,Move,Resize" CssClass="opaque"  KeepInScreenBounds="True"  >
                            
                                <ContentTemplate>
                                      <uc1:ViewEmissaoTimeSheetEdit ID="EditTimesheet" runat="server"  />
                                </ContentTemplate>
                            
                        </telerik:RadWindow>


            <CommandItemTemplate>
                                     <telerik:RadButton CommandName="InitInsert" RenderMode="Lightweight" ID="AddNewRecordButton" Text="Adicionar nova versão" ToolTip="Adicionar versão"
                                          runat="server" style="background:none; border:none; color:green;">
                                         <Icon PrimaryIconCssClass="rbAdd"></Icon>
                                     </telerik:RadButton>

The problem is, when i use Validators in my form atributtes, the form doesn't open when clicking the insert button.

Validators structure in my form (contained in a user control)


 <telerik:RadTextBox ID="txtAssinaturaTimesheet" runat="server" MaxLength="30"  Width="220px">
                                    </telerik:RadTextBox>
 <%-- <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtAssinaturaTimesheet" Display="Static" 
CssClass="ValidationFont" Text="Campo Obrigatório!" Font-Size="Medium" ></asp:RequiredFieldValidator> --%>

It is a common issue? How can i overcome it?

Harlem98
Top achievements
Rank 1
Iron
Iron
Iron
 updated question on 28 Dec 2021
1 answer
177 views

Hello

I'm trying to perform insert operation in a RadWindow. My scenario integrates the searchbox selected value, which should not be editable and automatically filled in insert, and for the rest, the normal empty fields, including the primary key.

I've already done the edit operation, with the following structure, but i cannot modify properly to the insert. Besides, when i push Insert button, i get the last assinged values, as the radwindow does not perform reload

Could you help me please?


 public void SaveFile(object sender, EventArgs e)
        {
            ListagemTimesheet model = new ListagemTimesheet();
           
            model.IDRH = Convert.ToInt32(rdpIE.Text);
            model.IDState = Convert.ToInt32(rcbEstado.SelectedValue);
            model.Obs = Obstxt.Text;
            model.Assin = txtAssin.Text;
            model.Date = Date.SelectedDate.Value;

            if (Objecto.ID > 0)
            {
                model.ID = Convert.ToInt32(FileID.Text);

                if (!string.IsNullOrEmpty(FileID.Text) && Convert.ToInt32(FileID.Text) > 0)
                {
                    model.ID = Convert.ToInt32(FileID.Text);
                    bll.UpdateFile(model);

                }
                else
                {
 
                }
            }
            else //Insert

//Command item events


                if (e.CommandName == "EditItem")
                {
                    
                    try
                    {
                        string script = "function f(){openRadWindow(); Sys.Application.remove_load(f);}Sys.Application.add_load(f);";
                        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", script, true);
                        e.Canceled = true;

                        int idts= int.Parse(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["ID"].ToString());
                        Dataclass ts= bll.GetFileByID(idts);
                        Editform.Object = ts;            
                        Editform.DataBind();
                        grid.Rebind();
                       
                      }


                    catch (System.Exception)
                    {
     
                    }

                    
                }

                    if (e.CommandName == "InsertItem")

//help

Doncho
Telerik team
 answered on 14 Dec 2021
1 answer
180 views

Hello,

To provide a bit of background, I have a page which refreshes it's data every two seconds but doesn't actually visibly refresh (By using a RadAjaxPanel). I'd like to click a button on a data row and populate the data from that row into a RadWindow (Like an edit dialog), and also have additional buttons in that dialog for various operations.

I have a RadWindow and code attached to a button which should set the RadWindow to be visible, however the RadWindow does not appear.

Example Code:

In Example.aspx -

<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Style="width: 100%">

//////Some MasterTableViews and RadGrids with various data here with buttons to pop up an edit dialog////

</telerik:RadAjaxPanel>

<telerik:radwindow runat="server" id="RadWindow1" Visible="False">
    <ContentTemplate>
        <asp:UpdatePanel ID="Updatepanel1" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
                <asp:Label ID="Label1" Text="I am an example" runat="server" />
            </ContentTemplate>
        </asp:UpdatePanel>
    </ContentTemplate>
</telerik:radwindow>

In Example.aspx.cs

   protected void RadGrid_ItemCommand(object sender, GridCommandEventArgs e)
    {

         this.RadWindow1.Visible= true;

}

 

When I click the button in the RadGrid to set the RadWindow to be visible, the .cs code executes but the RadWindow does not appear on the page.

 

Any help will be much appreciated.

 

Thanks,

 

Jack

Attila Antal
Telerik team
 answered on 13 Dec 2021
Narrow your results
Selected tags
Tags
+? more
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?