Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
93 views

We are using telerik old version which was using dll of rad controls.Now we are upgrading these controls to latest version of telerik and getting more code issue which was not working .

My following code is not working , So please let us know How we can fixed this issue.​

Telerik.Web.UI.RadTreeView was unable to find an embedded skin with the name '~/RadControls/TreeView/Skins/Arrows/3DBlue'. Please, make sure that the skin name is spelled correctly and that you have added a reference to the Telerik.Web.UI.Skins.dll assembly in your project. If you want to use a custom skin, set EnableEmbeddedSkins=false.

<telerik:RadTreeView ID="rtvTopLeftPatientMenu" Skin="Arrows/3DBlue" 
                            runat="server" OnNodeClick="rtvTopLeftPatientMenu_NodeClick" 
                            BeforeClientToggle = "BeforeToggleHandler" BeforeClientClick = "BeforeClientClick" >
 </telerik:RadTreeView>​​

ashishpandey21jan
Top achievements
Rank 1
 asked on 26 Oct 2015
1 answer
71 views

We are using telerik old version which was using dll of rad controls.Now we are upgrading these controls to latest version of telerik and getting more code issue which was not working .

My following code is not working , So please let us know How we can fixed this issue.​

'Telerik.Web.UI.RadEditor' does not contain a definition for 'ConvertToLower' and  'FileEncoding' .

Telerik.Web.UI.RadEditor rd = new Telerik.Web.UI.RadEditor();
        rd.ConvertToLower = true;                                                                  ----------error
        rd.FileEncoding = 65001; //UTF8                                                       --------error
        rd.Html = sMessage;
        sMessage = rd.Text;​

Marin Bratanov
Telerik team
 answered on 26 Oct 2015
1 answer
112 views

I have added telerik:RadDatePicker in a gridView. Its fetching results and calender as expected. But when i am exporting to excel. I am getting error.

 

Server Error in '/' Application.

Page cannot be null. Please ensure that this operation is being performed in the context of an ASP.NET request.Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.InvalidOperationException: Page cannot be null. Please ensure that this operation is being performed in the context of an ASP.NET request.

Source Error: 

Line 121: Line 122: // render the table into the htmlwriter Line 123: table.RenderControl(htw); Line 124: Line 125: // render the htmlwriter into the response
Source File: \App_Code\GridViewExportUtil.cs    Line: 123 

Stack Trace: 

[InvalidOperationException: Page cannot be null. Please ensure that this operation is being performed in the context of an ASP.NET request.] Telerik.Web.UI.ScriptRegistrar.GetScriptManager(Control control) +161 Telerik.Web.UI.RadWebControl.RegisterScriptDescriptors() +39​

 

Maria Ilieva
Telerik team
 answered on 26 Oct 2015
7 answers
69 views

I have a RadGrid with SEO Paging and Routing turned on. I'm using the NextPrevNumericAndAdvanced mode with TopAndBottom position.

When entering a custom page number (i.e. page 33 of 66) and click on the go button it just goes to the current page.

The individual page number buttons are fine (except the CSS issue I've reported before) and go to the correct page.

 

Kostadin
Telerik team
 answered on 26 Oct 2015
1 answer
316 views

I followed the attached example to create a RegularExpressionValidator for a input.

I have 3 inputs (2 DateTimePicker & 1 RadTextBox" and 5 "RadButton") to operate several actions. I now want that only the click on 3 of my 5 buttons make the validation of a specific "RadTextBox" because its an extra that is not always used.

Now, no matter which button I press I get the check for the RadTextBox and Error message presented.

  

Is there a filter or ​specification tag that I can use, that the RegularExpressionValidator use only my selected buttons?

(C#; VS2015; ASP 4.5; Win 7; UI for ASP.net AJAX latest Version)
 
 

Thanks

 

Attachment:
http://docs.telerik.com/devtools/aspnet-ajax/controls/input/radtextbox/limiting-allowable-values

Danail Vasilev
Telerik team
 answered on 26 Oct 2015
3 answers
685 views

Hello, 

 

I have one telerik radgrid with EditFormSttings and i have two fields (ID="editCodEmp" e ID="editNIFFilho") where (Enabled="false"). In code behind i need make (enable="true"), how?

 

My Code Behind:

 protected void Insert_Click(object source, EventArgs e)//Telerik.Web.UI.GridItemEventArgs
{
try
{
error.Style["Display"] = "none";
success.Style["Display"] = "none";

how to access "editCodEmp"?

how to access "editNIFFilho"?

CTGrid.MasterTableView.IsItemInserted = true;
CTGrid.MasterTableView.Rebind();
}
}
catch (Exception ex)
{
Logger.FillLog(ex, Session["Username"].ToString(), Session["Produto"].ToString(), "Insert_Click");
error.Style["Display"] = "block";
errorMessage.Text = ConfigurationManager.AppSettings["genericError"].ToString();
}
}

 

My Code ASPX:

 <telerik:RadGrid ID="CTGrid" AllowSorting="true" AutoGenerateColumns="false" PageSize="10"
AllowPaging="true" AllowMultiRowSelection="true" runat="server" GridLines="None"
Width="100%" Skin="TicketBlue" EnableEmbeddedSkins="false" OnItemDataBound="CTGrid_ItemDataBound"
OnUpdateCommand="CTGrid_UpdateCommand" OnInsertCommand="CTGrid_InsertCommand"
OnDeleteCommand="CTGrid_DeleteCommand" OnItemCreated="CTGrid_ItemCreated">
<MasterTableView Width="100%" Summary="RadGrid table" EditMode="EditForms" HierarchyLoadMode="Client"
ExpandCollapseColumn-Display="false" InsertItemDisplay="Top" DataKeyNames="id,NIFFilho, DescricaoEstado, DataRegisto">
<DetailTables>

..........

 

 

<EditFormSettings EditFormType="Template">
<FormTemplate>
<table align="left" width="100%" class="editTemplate">
<tr>
<td>
Nº Contribuinte *
</td>
<td>
<asp:TextBox ID="editCodEmp" Width="70px" CssClass="editFields" MaxLength="9" Enabled="false" runat="server" Text='<%# Bind("CodEmp") %>'></asp:TextBox>
</td>
<td>
Nome do Funcionário *
</td>
<td>
<asp:TextBox ID="editNomeFuncionario" Width="250px" CssClass="editFields" MaxLength="40" runat="server"
Text='<%# Bind("NomeFuncionario") %>'></asp:TextBox>
</td>
<td>
Nome a gravar no Cartão *
</td>
<td>
<asp:TextBox ID="editNomeGravar" Width="160px" CssClass="editFields" MaxLength="21" runat="server" Text='<%# Bind("NomeGravar") %>'></asp:TextBox>
</td>
</tr>
<asp:PlaceHolder ID="PlaceHolder1" runat="server" OnLoad="MakeVisibleOrNot">
<tr id = "CartaoFilhos" runat = "server">
<td>
Nº Contr. Filho *
</td>
<td>
<asp:TextBox ID="editNIFFilho" Width="70px" Enabled="False" CssClass="editFields" MaxLength="9" runat="server"
Text='<%# Bind("NIFFilho") %>'></asp:TextBox>
</td>

...........

<tr>
<td colspan="8">
<br />
* Campos obrigatórios
</td>
</tr>
<tr>
<td align="left" colspan="6">
<asp:Button ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Gravar" : "Gravar" %>'
runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'>
</asp:Button>&nbsp;
<asp:Button ID="btnCancel" Text="Cancelar" runat="server" CausesValidation="False"
CommandName="Cancel"></asp:Button>
</td>
</tr>
<asp:HiddenField ID="id" runat="server" Value='<%# Bind( "id") %>' />
</table>
</FormTemplate>
</EditFormSettings>
</MasterTableView>​

Viktor Tachev
Telerik team
 answered on 26 Oct 2015
5 answers
116 views
I have various applications running on windows server 2008 and IIS 7 (.net 4.0 and 4.5). For some reason any application using the RadScriptManager is now throwing a 404 error on all .axd files and a "sys is not defined" error. The strange thing is that if I switch the the asp:scriptmanager these applications work correctly. Is there a setting on the server or in IIS that could cause this behavior? I am using version 2012.2.912.40 and 2013.3.1015.45 and they are both exhibiting the same behavior.
Marin Bratanov
Telerik team
 answered on 26 Oct 2015
1 answer
186 views

I need to validate that the minimum date to select is equal to 6 months before the current date.
For example: Today's date = 21.10.2015
this.dt_Date.MaxDate = DateTime.Now; so
MinDate = 04.21.2015

 

Vasil
Telerik team
 answered on 26 Oct 2015
4 answers
142 views

I have a radgrid that I am dynamically creating in the Page_Init method as mentioned here. I have multiple templated columns that dispaly a label in the ItemTemplate and a RadComboBox and RadTimePicker in the EditItemTemplate. Both are properly displayed. However, on editing in batch mode, I am only able to get the value of the radcombobox and not of the time picker. I have noticed that the DataBinding events of my EditItemTemplate controls do not fire at all. Even the overridden ExtractValues method doesnt hit my breakpoint. Have attached the code..Any help is appreciated.

public class MyItemTemplate : IBindableTemplate
    {
        protected Label lblProj;
 
        private string colName;
 
 
        public MyItemTemplate(string cName)
        {
            colName = cName;
 
        }
 
        public void InstantiateIn(System.Web.UI.Control container)
        {
            lblProj = new Label();
            lblProj.ID = "ProjTime_" + colName;
            lblProj.Width = Unit.Pixel(140);
            lblProj.DataBinding += new EventHandler(lblProj_DataBinding);
            container.Controls.Add(lblProj);
        }
 
        void lblProj_DataBinding(object sender, EventArgs e)
        {
            Label lblProj = (Label)sender;
            GridDataItem container = (GridDataItem)lblProj.NamingContainer;
            lblProj.Text = ((DataRowView)container.DataItem)[colName].ToString();
        }
 
        public IOrderedDictionary ExtractValues(Control container)
        {
            OrderedDictionary values = new OrderedDictionary();
            return values;
        }
 
    }
public class MyEditTemplate : ITemplate
   {
       protected RadComboBox PDay;
       protected static string date;
       protected static string time;
       protected RadTimePicker PTime;
       private string colName;
       
       public MyEditTemplate(string cName)
       {
           colName = cName;
           
       }
 
       public IOrderedDictionary ExtractValues(Control container)
       { //breakpoint here doesnt get hit
           OrderedDictionary values = new OrderedDictionary();
                       return values;
       }
 
       
       public void InstantiateIn(System.Web.UI.Control container)
       {
           PDay = new RadComboBox();
           PDay.ID = "PDay_" + colName;
           PDay.Width = Unit.Pixel(150);
           PDay.AllowCustomText = true;
           PDay.DataBinding += new EventHandler(PDay_DataBinding);
 
           //adding Items to PDay.Items here
 
           PTime = new RadTimePicker();
           PTime .ID = "PTime_" + colName;
           PTime .Width = Unit.Pixel(100);
           PTime .DataBinding += new EventHandler(PTime_DataBinding);
           PTime .DateInput.ReadOnly = true;
 
           container.Controls.Add(PDay);
           container.Controls.Add(PTime );
 
       }
 
       void PTime_DataBinding(object sender, EventArgs e)
       { //breakpoint here doesnt get hit
           RadTimePicker timePicker = (RadTimePicker)sender;
           GridDataItem container = (GridDataItem)timePicker.NamingContainer;
           timePicker.SelectedDate = Convert.ToDateTime(((DataRowView)container.DataItem)[colName].ToString());
                   }
 
 
       public void PDay_DataBinding(object sender, EventArgs e)
       { //breakpoint here doesnt get hit
           RadComboBox cBox = (RadComboBox)sender;
           GridDataItem container = (GridDataItem)cBox.NamingContainer;
           cBox.Text = ((DataRowView)container.DataItem)[colName].ToString();
         }
 
 
 
   }

Angel Petrov
Telerik team
 answered on 26 Oct 2015
5 answers
157 views
Hello,

In order to integrate RadUpload control with SharePoint 2010 (IIS 7.5) I wrote an application page MyCustomUpload.aspx:
<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Register Tagprefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI, Version=2011.3.1115.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MyCustomUpload.aspx.cs" Inherits="LargeFileUploadSP.Layouts.LargeFileUploadSP.MyCustomUpload" DynamicMasterPageFile="~masterurl/default.master" %>
 
<asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">
 
</asp:Content>
 
<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
    <telerik:RadProgressManager ID="Radprogressmanager1" runat="server" />
     
    <table>
        <tr>
            <td>
                <telerik:RadUpload ID="RadUpload1" runat="server" />
            </td>
            <td>
                <div>
                    <asp:Label ID="labelNoResults" runat="server" Visible="True">No uploaded files yet</asp:Label>
                    <asp:Repeater ID="repeaterResults" runat="server" Visible="False">
                        <HeaderTemplate>
                            <div>Uploaded files in the target folder:</div>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <%#DataBinder.Eval(Container.DataItem, "FileName")%>
                            <%#DataBinder.Eval(Container.DataItem, "ContentLength").ToString() + " bytes"%>
                            <br />
                        </ItemTemplate>
                    </asp:Repeater>
                </div>
            </td>
        </tr>
    </table>
 
    <div class="submitArea">
        <asp:Button runat="server" ID="SubmitButton" Text="Upload files" OnClick="SubmitButton_Click" />
    </div>
    <telerik:RadProgressArea runat="server" ID="ProgressArea1">
    </telerik:RadProgressArea>
</asp:Content>
 
<asp:Content ID="PageTitle" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">
My custom upload page
</asp:Content>
 
<asp:Content ID="PageTitleInTitleArea" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea" runat="server" >
My custom upload page
</asp:Content>

with code behind cs:

using System;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using System.Web.UI;
using Telerik.Web.UI;
 
namespace LargeFileUploadSP.Layouts.LargeFileUploadSP
{
    public partial class MyCustomUpload : LayoutsPageBase
    {
        private ScriptManager scriptManager;
         
        protected void Page_Load(object sender, EventArgs e)
        {
            RadUpload1.TargetPhysicalFolder = @"C:\telerik_uploads\";
        }
 
        protected void SubmitButton_Click(object sender, EventArgs e)
        {
            if (RadUpload1.UploadedFiles.Count > 0)
            {
                repeaterResults.DataSource = RadUpload1.UploadedFiles;
                repeaterResults.DataBind();
                labelNoResults.Visible = false;
                repeaterResults.Visible = true;
            }
            else
            {
                labelNoResults.Visible = true;
                repeaterResults.Visible = false;
            }
        }
    }
}

I'm using the standard .net ScriptManager provided in default SP master page.
I was able to upload files with no additional configuration but no progress bar was displayed and I received a warning pop-up every time the file was uploaded. Following these instructions (for IIS7): http://www.telerik.com/help/aspnet-ajax/moss-progress-area-in-moss.html and http://www.telerik.com/help/aspnet/upload/uploadinglargefiles.html I configured the progress handler and upload limits.

Here are some parts of my web.config file (for SP web app):

<system.webServer>
    <security>
        <requestFiltering allowDoubleEscaping="true">
            <requestLimits maxAllowedContentLength="2147483647" />
        </requestFiltering>
    </security>
    ...
    <httpRuntime maxRequestLength="1024000" executionTimeout="3600" />
    ...
    <modules runAllManagedModulesForAllRequests="true">
        ...
        <!-- For Telerik RadUpload control -->
        <add name="RadUploadHttpModule" type="Telerik.Web.UI.SPRadUploadHttpModule, Telerik.Web.UI, Version=2011.3.1115.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" preCondition="integratedMode" />
    </modules>
    <handlers>
        ...
        <!-- For Telerik RadUpload control -->
        <add path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler, Telerik.Web.UI, Version=2011.3.1115.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" verb="*" preCondition="integratedMode" name="Telerik_RadUploadProgressHandler_ashx" />
    </handlers>
</system.webServer>
<location path="Telerik.RadUploadProgressHandler.ashx">
    <system.web>
        <authorization>
            <allow users="*"/>
        </authorization >
    </system.web>
</location>
<location path="WebResource.axd">
    <system.web>
        <authorization>
            <allow users="*"/>
        </authorization >
    </system.web>
</location>
<location path="Telerik.Web.UI.WebResource.axd">
    <system.web>
        <authorization>
            <allow users="*" />
        </authorization>
    </system.web>
</location>

I've also changed the C:\Windows\System32\inetsrv\config\applicationHost.config file as described in documentation:

<section name="requestFiltering" overridemodedefault="Allow" />

in all sectionGroups where it occurred.

Now when I'm trying to upload a file I get 404 and no files are uploaded to target folder.

Logs from IIS:

--- begin ---

2011-12-30 12:25:28 fe80::f158:8004:66bb:fd69%11 GET /sites/test/Telerik.RadUploadProgressHandler.ashx RadUrid=b09a2128-86c0-4f8c-adae-9479c2da54ef&RadUploadTimeStamp=1325247928752& 10001 - fe80::f158:8004:66bb:fd69%11 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+6.1;+WOW64;+Trident/4.0;+SLCC2;+.NET+CLR+2.0.50727;+.NET+CLR+3.5.30729;+.NET+CLR+3.0.30729;+.NET4.0C;+.NET4.0E) 401 1 2148074254 1
2011-12-30 12:25:28 fe80::f158:8004:66bb:fd69%11 POST /sites/test/_layouts/LargeFileUploadSP/MyCustomUpload.aspx RadUrid=b09a2128-86c0-4f8c-adae-9479c2da54ef 10001 - fe80::f158:8004:66bb:fd69%11 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+6.1;+WOW64;+Trident/4.0;+SLCC2;+.NET+CLR+2.0.50727;+.NET+CLR+3.5.30729;+.NET+CLR+3.0.30729;+.NET4.0C;+.NET4.0E) 401 1 2148074254 14
2011-12-30 12:25:28 fe80::f158:8004:66bb:fd69%11 GET /sites/test/Telerik.RadUploadProgressHandler.ashx RadUrid=b09a2128-86c0-4f8c-adae-9479c2da54ef&RadUploadTimeStamp=1325247928752& 10001 DEVMM\Administrator fe80::f158:8004:66bb:fd69%11 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+6.1;+WOW64;+Trident/4.0;+SLCC2;+.NET+CLR+2.0.50727;+.NET+CLR+3.5.30729;+.NET+CLR+3.0.30729;+.NET4.0C;+.NET4.0E) 200 0 0 14
2011-12-30 12:25:28 fe80::f158:8004:66bb:fd69%11 POST /sites/test/_layouts/LargeFileUploadSP/MyCustomUpload.aspx RadUrid=b09a2128-86c0-4f8c-adae-9479c2da54ef 10001 DEVMM\Administrator fe80::f158:8004:66bb:fd69%11 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+6.1;+WOW64;+Trident/4.0;+SLCC2;+.NET+CLR+2.0.50727;+.NET+CLR+3.5.30729;+.NET+CLR+3.0.30729;+.NET4.0C;+.NET4.0E) 404 0 0 117

--- end ---

I've read some posts on this forum related with RadUpload and http 404 problems but none of them were helpful in my case.

Could you please help me to solve this problem?

Best regards
Marek Mierzwa
Gaurav
Top achievements
Rank 1
 answered on 26 Oct 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?