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

When I try to edit a row, i get the following error....

Unhandled exception at line 7, column 1 in http://localhost:49573/ScriptResource.axd?d=mbGZm65DzNC0tMTq0Elbce0yp2eiMDoWRQEIIn3twTe4dAIfNkGHxTWrZ831kuBdsqp_-Y_OAibsgWU704RhZMjoTfT5_SQJxqfo7sMEVXBBl32oE7HNV6t_TCbDwf2_gcZ8IUGDyk-eU9RGyLmgCA2&t=6e6e42a6

0x800a1391 - Error en tiempo de ejecución de JavaScript: '$telerik' no está definido

Please could you help me to discover how to avoid this error?
Viktor Tachev
Telerik team
 answered on 18 Apr 2016
1 answer
108 views

 

ascx design 

<%@ Control Language="C#" AutoEventWireup="True" CodeBehind="ucAddtionalConditions.ascx.cs" Inherits="ClientPortal.FNFConnect.Web.UI.Controls.Submit.ucAddtionalConditions" %>
<%@ Register Assembly="GtCustomWebControlLibrary" Namespace="Gryphtech.Translation.Web.UI.WebControls" TagPrefix="cc1" %>


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

        <style type="text/css">
            .style1
            {
                width: 125px;
            }
        </style>
<cc1:GtTranslationManager ID="ucAdditionalConditions_CustomManager" 
runat="server" TranslationGroupId="294604c7-0340-4ffd-81b9-cf62c47f1b53">
</cc1:GtTranslationManager>

<div class="webPartControl">
    <h4>
           <cc1:GtTranslatableLabel ID="lblHeader" runat="server" 
                    TranslationItemId="9131ec56-4b3f-4fd1-b7a5-4a88bdff2a7a" 
                    TranslationManagerId="ucAdditionalConditions_CustomManager">ADDITIONAL 
                CONDITIONS</cc1:GtTranslatableLabel>
                </h4>
    <div class="webPartControlContents">
        <table class="controlTable">
            <tr id="tdAddCondition" runat="server">
                <td class="divLine widthMedium">
                    <cc1:GtTranslatableLabel ID="lblAddConditions" runat="server" 
                        TranslationItemId="017b75f2-4811-4ba6-ba46-de63e71e1903" 
                        TranslationManagerId="ucAdditionalConditions_CustomManager">Add 
                    Condition(s):</cc1:GtTranslatableLabel>
                    &nbsp;
                </td>
                <td class="divLine" style="width: 70%">
                  <telerik:RadComboBox runat="server" ID="ddlConditions" ExpandDirection="Up" Width ="98%" MaxHeight="250">
                    </telerik:RadComboBox>
                </td>

                <td class="divLine">
                   <a class="roundButton" onclick="copyCondition()" type="button"><span><% = lblAdd.Text %></span></a>
                </td>
            </tr>
            <tr>
               <td class="divLineLast widthMedium">
                    &nbsp;
                </td>
                <td class="divLineLast" style="width: 70%">
                    <asp:TextBox ID="txtCondition" runat="server" Height="250px" 
                        TextMode="MultiLine" Width="97%"></asp:TextBox>
                </td>
                <td class="divLineLast">
                    <a id="lnkClear" runat="server" onclick="clearConditions()" type="button" class="roundButton"><span><% = lblClear.Text %></span></a>&nbsp;
                </td>
            </tr>
        </table>
    </div>
</div>
        <script type="text/javascript">
            function copyCondition()
            {
                var ddl = $find('<% = ddlConditions.ClientID %>');
                if (ddl.get_selectedIndex() > 0)
                {
                    var textBox = $get('<% = this.txtCondition.ClientID %>');
                    if (textBox.value == '')
                        textBox.value = '- ' + ddl.get_selectedItem().get_value();
                    else
                        textBox.value += '\r' + '- ' + ddl.get_selectedItem().get_value();
                    
                    ddl.selectedIndex = 0;
                }
            }
        
            function clearConditions()
            {
                $get('<% = this.txtCondition.ClientID %>').value = '';
                var ddl = $find('<% = ddlConditions.ClientID %>');
                ddl.get_items().getItem(0).select();
            }
        </script>
<cc1:GTTranslatableEditPanel ID="ucAddtionalConditions_CustomEdit" 
    runat="server" TranslationManagerId="ucAdditionalConditions_CustomManager">
    <cc1:GtTranslatableLabel ID="lblClear" runat="server" 
        TranslationItemId="f25a42ae-784b-44ba-878c-8fece4df0b48" 
        TranslationManagerId="ucAdditionalConditions_CustomManager">
        Clear
    </cc1:GtTranslatableLabel>
    <br />
    <cc1:GtTranslatableLabel ID="lblAdd" runat="server" 
        TranslationItemId="e62442e9-9b30-46ac-8080-2a8da22ecbda" 
        TranslationManagerId="ucAdditionalConditions_CustomManager">
        Add
    </cc1:GtTranslatableLabel>
</cc1:GTTranslatableEditPanel>

 

c# server side code

 

using System;
using System.Text;
using System.Web.UI;
using System.Web.UI.WebControls;
using ClientPortal.Web.UI;
using FNF.CP.Data;
using Telerik.Web.UI;


namespace ClientPortal.FNFConnect.Web.UI.Controls.Submit
{
    public partial class ucAddtionalConditions : PortalBaseSubmitControl, IsubmitLoadNPSProvider
    {
        #region PageEvents
        protected void Page_Load(object sender, EventArgs e)
        {
            ddlConditions.DataBinding += new EventHandler(ddlConditions_DataBinding);

            ddlConditions.DataBound += delegate
            {
                //Hide dropdown + Add button if table used to populate drop-down list is empty
                if (ddlConditions.Items.Count == 1)
                {
                    tdAddCondition.Visible = false;
                    lnkClear.Visible = false;
                }
            };

            if (!Page.IsPostBack)
            {
                ddlConditions.DataBind();
            }
        }
        #endregion

        #region Binding

        void ddlConditions_DataBinding(object sender, EventArgs e)
        {
            ddlConditions.AppendDataBoundItems = true;
            ddlConditions.Items.Clear();
            ddlConditions.DataSource = FNF.CP.Data.AdditionalConditionsDB.getAdditionalConditions(ucAdditionalConditions_CustomManager.Language.LanguageCode);
            ddlConditions.DataValueField = "conditionName";
            ddlConditions.DataTextField = "conditionName";

            ddlConditions.Items.Insert(0, new RadComboBoxItem(string.Empty));

        }

        #endregion

        #region IsubmitLoadNPSProvider Members

        public void fillProvider(ref FNF.NPSWS.fnfnpsBodyRequest request, ref FNF.SOA.Appraisals.AppraisalBodyRequest aRequest)
        {
            string condition = txtCondition.Text.Trim();
            if (request == null || condition.Length == 0)
                return;

            StringBuilder sb = new StringBuilder();
            if (condition.Contains(Environment.NewLine))
            {
                sb.Append("<ul style='list-style-type:normal'>");
                foreach (string item in condition.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries))
                {
                    sb.Append("<li>").Append(item.TrimStart(new char[] { '-', ' ' })).Append("</li>");
                }
                sb.Append("</ul>");
            }
            else
            {
                sb.Append(condition);
            }

            request.Conditions = new string[1] { sb.ToString() };
        }

        public void loadSubmitData(ConnectFile file)
        {
            // no implementation yet
        }

        #endregion
    }
}

 

 

Nencho
Telerik team
 answered on 18 Apr 2016
1 answer
53 views

When using IE8, if I add an image to the content in the editor via the Image Manager, the SRC attribute gets an absolute URL. I can reproduce this on your demo at http://demos.telerik.com/aspnet-ajax/editor/examples/filemanagers/defaultcs.aspx. 

When using IE9 or higher, the SRC gets a virtual path, which is what we want.

Is there a way to make IE8 get a virtual path?

Joana
Telerik team
 answered on 18 Apr 2016
2 answers
113 views

I have a standard aspx page that has a RadTextBox and RadGrid (with datasource)

I want to see if there is a way to type into the RadTextBox a value and the value that matches a particular row in the RadGrid would get selected/highlighted.

 

Thanks for any help on this.

Rusty
Top achievements
Rank 1
 answered on 18 Apr 2016
4 answers
109 views
I have one scenario where the gridview has 2 rows like what i have attached.

Gridview having data as like I have mentioned in the file.

COLUMN 3 to COLUMN 6 having texbox where the values are entered by the user

COLUMN 1 and COLUMN 2 of ROW 1 and ROW 2 will have the same value as mentioned.
I need to know how to add a new row in the grid if the button is clicked

And the entered value should not get affected. It should be present.
The new row should be added with COLUMN1 and COLUMN 2 having same name as that of the ROW 1 and ROW 2
Even if the user clicks again the button the old rows should not get affected.




Viktor Tachev
Telerik team
 answered on 18 Apr 2016
2 answers
194 views

Hi,

 

I have two editbuttons in my gridview, I my form template I have 4 dropdowns.

When I click add new record button all the 4 dropdowns controls should be enable to add a record.

when I click the edit button 1 (Command name is EditEmp)  dropdown 1 & dropdown 2 should be enabled and dropdown 3 & dropdown 4 should be disabled to update the record

when I click the edit button 2 (Command name is EditDependent) on the same grid dropdown 1 & dropdown 2 should be disabled and dropdown 3 & dropdown 4 should be enabled to update the record.

Kindly let me know on which event I will do this changes.

thanks,

Ganeshkumar

 

 

Ganeshkumar
Top achievements
Rank 1
 answered on 18 Apr 2016
1 answer
547 views

I found that when I select many files (e.g. around 400 jpg, 6KB per files) in AsyncUpload, the upload speed would become slower and slower. Initially, the upload speed could have around 2.4KB/s, but it gradually drops to even below 40 Bytes per second as the upload proceeds. It takes me so long time to upload a large amount of files. 

Are there any configurations to improve the upload speed of multiple files ?

 

Thanks!

Hristo Valyavicharski
Telerik team
 answered on 18 Apr 2016
1 answer
295 views

We have an update panel on the page that contains rows of controls.  The user can add additional rows or remove existing ones using a button that performs an Ajax postback.  If the user adds additional rows, the values of the RadComboBox remain and life is good.  However, if the user removes a row, the combobox value is lost (the items are there, but the selected index is set to -1).

In stepping through the code, I can see that the values are indeed set after Page_Load and Page_PreRender, but when the page is finally displayed, the values have been removed.

I've searched high and low and it appears this is an issue others have experienced as well (http://www.telerik.com/forums/selectedvalue-lost-on-postback-in-dynamically-added-user-controls).  Unfortunately, I can't bind the values in Page_Init (as suggested in the post) as I need information from ViewState that isn't available until Page_Load.

All other controls on the update panel retain their value; it's *only* the comboboxes that lose theirs.

Has anyone else experienced this lately and, if so, what was the workaround?

We're using Telerik 2014 Q2 in VS2015 (C#).

Nencho
Telerik team
 answered on 18 Apr 2016
1 answer
99 views

I cannot seem to use jQuery to select a CheckBoxList inside a RadWindow ContentTemplate.Clicking on the checkboxes does nothing, but if I move the CheckBoxList out of the RadWindow it works fine. I've probably tried a dozen selectors, none work.

<telerik:RadWindow ID="MonthsWindow" runat="server" Skin="Metro" AutoSize="true" MinWidth="575px" MaxWidth="700px" MaxHeight="600px" KeepInScreenBounds="true" Left="100" Top="100" VisibleOnPageLoad="false" Behaviors="Close, Move" RenderMode="auto" DestroyOnClose="true" EnableAjaxSkinRendering="true" ShowContentDuringLoad="true">
<ContentTemplate>
<asp:CheckBoxList ID="CheckBoxList1" runat="Server">
     <asp:ListItem Text="Red" Value="red"></asp:ListItem>
     <asp:ListItem Text="Blue" Value="blue"></asp:ListItem>
     <asp:ListItem Text="Green" Value="green"></asp:ListItem>
</asp:CheckBoxList>
                                     
</ContentTemplate>
</telerik:RadWindow>

$("[id*='CheckBoxList1']").click(function () {
    //code
});
Marin Bratanov
Telerik team
 answered on 18 Apr 2016
5 answers
782 views
Hi everyone,

I need your help.
I added Telerik to a old project. radGrid works good, and i can open radWindow.
I have followed this demo http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandwindow/defaultcs.aspx?product=window

But for now, i can't close the radWindow, the reason : window.radWindow and window.frameElement.radWindow from GetRadWindow() script function are undefined.

If someone can help me.

My code :
default.aspx
<telerik:RadScriptManager runat="server" EnableViewState="false" ID="RadScriptManager1" />
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
             
            function ShowEditForm(id, rowIndex) {
                var anneeID = 0;
                var typeRessID = 0;
                var grid = $find("<%= RadGrid1.ClientID %>");
                var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element();
 
                anneeID = document.getElementById("<%= cboAnnees.ClientID %>").value;
                if (document.getElementById("rbResident").checked == true) {
                    typeRessID = 1;
                }
                if (document.getElementById("rbExterne").checked == true) {
                    typeRessID = 2;
                }
                if (document.getElementById("rbAutre").checked == true) {
                    typeRessID = 3;
                }
                 
                grid.get_masterTableView().selectItem(rowControl, true);
 
                window.radopen("UpdateInfo.aspx?ID=" + id + "&TYPERESSID=" + typeRessID + "&ANNEEID=" + anneeID, "UserListDialog");
                return false;
            }
             
            function ShowInsertForm() {
                window.radopen("UpdateRessourceFrameset.aspx", "UserListDialog");
                return false;
            }
            function refreshGrid(arg) {
                if (!arg) {
                    $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
                }
                else {
                    $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("RebindAndNavigate");
                }
            }
            
        </script>
    </telerik:RadCodeBlock>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

<telerik:RadGrid OnItemCreated="RadGrid1_ItemCreated" ID="RadGrid1" runat="server"
        AllowPaging="True" EnableViewState="true" Width="97%">
        <PagerStyle Mode="NumericPages"></PagerStyle>
        <MasterTableView pagesEnableViewState="true" AutoGenerateColumns="False" DataKeyNames="RESS_ID" ShowHeadersWhenNoRecords="false" ClientDataKeyNames="RESS_ID"
            Width="100%" PageSize="20">
            <Columns>
                <telerik:GridBoundColumn DataField="INFO2" HeaderText="Year" ReadOnly="True">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="INFO1" HeaderText="Name"/>
                 
                <telerik:GridTemplateColumn UniqueName="TemplateEditColumn">
                    <ItemTemplate>
                         
                        <asp:HyperLink ID="EditLink" runat="server" Text="Edit"></asp:HyperLink>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
            </Columns>
            <CommandItemTemplate>
                <a href="#" onclick="return ShowInsertForm();">No records...</a>
            </CommandItemTemplate>
        </MasterTableView>
        <ClientSettings>
            <Selecting AllowRowSelect="false"></Selecting>
             
        </ClientSettings>
    </telerik:RadGrid>
             
            <telerik:RadWindowManager ID="RadWindowManager1" EnableViewState="False" runat="server">
        <Windows>
            <telerik:RadWindow ID="UserListDialog" runat="server" Title="Editer une ressource" Height="500px"
                Width="930px" Left="150px" ReloadOnShow="true" ShowContentDuringLoad="false"
                Modal="true">
            </telerik:RadWindow>
        </Windows>
    </telerik:RadWindowManager>

default.aspx.vb
Protected Sub RadAjaxManager1_AjaxRequest(ByVal sender As Object, ByVal e As UI.AjaxRequestEventArgs) Handles RadAjaxManager1.AjaxRequest
       If e.Argument = "Rebind" Then
           RadGrid1.MasterTableView.SortExpressions.Clear()
           RadGrid1.MasterTableView.GroupByExpressions.Clear()
           RadGrid1.Rebind()
       ElseIf e.Argument = "RebindAndNavigate" Then
           RadGrid1.MasterTableView.SortExpressions.Clear()
           RadGrid1.MasterTableView.GroupByExpressions.Clear()
           RadGrid1.MasterTableView.CurrentPageIndex = RadGrid1.MasterTableView.PageCount - 1
           RadGrid1.Rebind()
       End If
   End Sub
 
   Protected Sub RadGrid1_ItemCreated(ByVal sender As Object, ByVal e As GridItemEventArgs)
       If TypeOf e.Item Is GridDataItem Then
           Dim editLink As HyperLink = DirectCast(e.Item.FindControl("EditLink"), HyperLink)
           editLink.Attributes("href") = "#"
           editLink.Attributes("onclick") = [String].Format("return ShowEditForm('{0}','{1}');", e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("RESS_ID"), e.Item.ItemIndex)
       End If
   End Sub

Updateinfo.aspx
<script type="text/javascript">
     function CloseAndRebind(args) {
         GetRadWindow().BrowserWindow.refreshGrid(args);
         GetRadWindow().close();
     }
 
     function GetRadWindow() {
        var oWindow = null;
         if (window.radWindow) oWindow = window.radWindow;
         else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
 
         return oWindow;
     }
 
     function CancelEdit() {
         window.UserListDialog.close();
     }
        </script>
 
 
....
 
<asp:ScriptManager id="smUpdateRess" runat="server" />
 
<asp:DetailsView runat="server" ID="DetailsView1" OnItemUpdating="DetailsView1_ItemUpdating" AutoGenerateEditButton="false" AutoGenerateRows="false" GridLines="None">
        
  
       <Fields>
            
             
           <asp:TemplateField>
               
               <EditItemTemplate>
                   <asp:Button ID="btAddContact" runat="server" Text="Save Contact" CommandName="Update" />
                    
                   <table border =0 style="width:750px">
                        <tr>
                            <td  style="height: 31px" colspan=4>
                           <asp:Label id="lblInfo1" runat="server" Text="Year: "></asp:Label>                            
                           <asp:TextBox id="txtInfo2" runat="server" Width="70px"  ReadOnly="true"  BackColor="LightGray" Text='<%# Container.DataItem("Info2") %>'></asp:TextBox>     
                             <asp:Label id="lblinfo2" runat="server" Text="Name:"></asp:Label>
                            <asp:TextBox ID="txtInfo1" runat="server" Width="70px"  ReadOnly="true"  BackColor="LightGray" Text='<%# Container.DataItem("INFO1") %>'></asp:TextBox>                    
                             
                            </td>            
                        </tr>
                         
                   </table>
               </EditItemTemplate>
           </asp:TemplateField>
            
       </Fields>
   </asp:DetailsView>

updateinfo.aspx.vb

on button click
 
ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "CancelEdit();", True)

But like i said, i get error of null with window.radWindow orwindow.frameElement.radWindow

thanks for your help.
Marin Bratanov
Telerik team
 answered on 18 Apr 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?