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

Hello,

I am facing an issue when uploading to AWS S3, which is automatic renaming of the uploaded file 

original file name is BD-september-2022-quarter.csv

and the new file name is : 03fb8435-90ea-4378-a602-925d37db8277_BD-september-2022-quarter.csv

i don't know why after upload the original filename is not being kept
 

<telerik:RadCloudUpload ID="RadCloudUpload1" runat="server" RenderMode="Lightweight" MultipleFileSelection="Automatic" OnClientFileUploading="OnClientFileUploading" AllowedFileExtensions=".csv" ProviderType="Amazon" localization-SelectButtonText="Browse to Upload ..." MaxFileSize="3145728" OnFileUploaded="RadCloudUpload1_FileUploaded"/>

Thanks for your help
Attila Antal
Telerik team
 answered on 20 Mar 2023
2 answers
146 views

Hello

I have a ASP.NET AJAX site which lets you generate bills. These have a header and lines.

It does have a button to generate a PDF report of this bill.

The form is a RadDataForm, always in edit mode, and inside of it, besides header fields, it's a RadGrid for the bill lines .

Until now, you have to first click the built in save button in the RadDataForm, then you can click on the generate PDF, otherwise the PDF is outdated (it doesn't save the modified header and lines). Now it's required that only clicking on the generate PDF button first save everything in the radDataForm, then it generates the PDF with updated values. I managed to save the header data before executing the PDF code but I can't figure out how to save the lines (RadGrid), because if I trigger it, then stops executing and the PDF report isn't generated at all.

The Save button has a client side Javascript event attached to save the RadGrid status.

 var grid1 = $telerik.findControl(document.documentElement, "RadGrid1");
var batchManager1 = grid1.get_batchEditingManager();
var hasChanges = batchManager1.hasChanges(grid1.get_masterTableView());
if (hasChanges) {
  batchManager1.saveTableChanges([grid1.get_masterTableView()]);
  ajaxPanel.ajaxRequest("saveChanges");

} else {
  var ajaxPanel = $telerik.findControl(document.documentElement, "RadAjaxPanel1");
  ajaxPanel.ajaxRequest("saveChanges");
}

If I add that same client side function in the generate PDF, it saves the RadGrid but it doesn't execute the generate PDF code (possibly due to the Postback preventing it to reach the server side function that generates the report and PDF)

 

I use the BatchEditCommand to manually get the updated, inserted or deleted rows and execute the SQL queries to do that. But I can't get the list of commands (the GridBatchEditingEventArgs e) without this event

Is there a way to save the radDataForm first (including the RadGrid) then generating the PDF file (it's a server side function)

Many thanks!

Christian
Top achievements
Rank 1
Iron
 updated answer on 20 Mar 2023
0 answers
133 views

I have to change the value of a raddateinput server side.

On client side I have an Ajax function than show the age.

What I have to use on server-side and on client-side to fie event?

For example this doesn't works:

server side:

RdMyDateInput.SelectedDate = DateTime.Parse(MyStringDate);

client side:

<telerik:RadDateInput ID="RdNyDateInput" runat="server" ClientEvents-OnValueChanged="AgeCount" Culture="it-IT" MaxDate="2999-12-31" MinDate="1900-01-01" Skin="Silk">
                 <ClientEvents OnValueChanged ="AgeCount"></ClientEvents>
</telerik:RadDateInput>

the event fires only on web page, not by server side.

Thanks

Renati

RRE
Top achievements
Rank 2
Iron
 asked on 17 Mar 2023
0 answers
239 views

Hi Telerik,

 

I want to trigger the Document manager insert button event when I inserting an attachments into the hyperlink manager when I open the document manager from the hyperlink manager.

 

I tried by adding the below code based on the documentation, 

Added OnClientPasteHtml event for RadEditor

<telerik:RadEditor ID="reNotes" runat="server" Width="800" Height="300" Skin="Windows7" 
                                OnClientLoad="OnClientLoad" EnableResize="False" AutoResizeHeight="true" EditModes="Design"
                                OnClientCommandExecuting="OnClientCommandExecuting" OnClientPasteHtml="OnClientPasteHtml" >
                                <DocumentManager MaxUploadFileSize="20000000" SearchPatterns="*.*" />
                                <Content>                                     
                                
                                </Content>
                            </telerik:RadEditor>
Also added the corresponding function in the script
 function OnClientPasteHtml(sender, args) {
                    alert(10);
                    debugger;
                    var commandName = args.get_commandName();
                    var value = args.get_value();

                    if (commandName == "Paste") {
                        // The StripPathsFilter() method receives as a parameter an array of strings (devided by a white space) that will be stripped from the absolute links.
                        var domainName = "http://" + window.location.host; //returns the hostname and port number of the current URL
                        var filter = new Telerik.Web.UI.Editor.StripPathsFilter([domainName]); //strip the domain name from the absolute path

                        var contentElement = document.createElement("SPAN");
                        //contentElement.innerHTML = value;
                        var newElement = filter.getHtmlContent(contentElement);
                        alert(newElement.outerHTML);
                        //args.set_value(newElement.outerHTML);  //set the modified pasted content in the editor
                    }
                }

But the event not triggering when the insert button clicked.

 

Please note : I opened the document manager from the hyperlink manager popup.

Please see the screenshot

 

Is there any way to trigger the insert button event, So that I can access the current attachment url and replace the same with an encrypted url and also display the encrypted URL in the url field of the hyperlink manager.

 

Thanks & regards,


jamsheer
Top achievements
Rank 1
Veteran
 updated question on 17 Mar 2023
1 answer
195 views

Within a page, I have the following - 

<telerik:RadGrid ...

     <telerik:GridAttachmentColumn ... AllowedFileExtensions=".png,.gif,.jpg,.jpeg" ... />

</ telerik:RadGrid>

When editing an item within the grid, and clicking the 'Select' option on the grid's edit column related to the GridAttachmentColumn, I'm receiving this popup - 

 

I want to restrict the files a user can select to upload through this dialog to those defined within the 'AllowedFileExtensions' property of the control, either from within the HTML, or in the code behind.

How can I go about doing that? If this is not the correct place to be asking this question, where on the forum should I be asking this question?

Thanks.

Attila Antal
Telerik team
 answered on 16 Mar 2023
2 answers
547 views

How to un-highlight filtered yellow records. I used Ctrl+F to search keywords, those matching records were highlighed in yellow. Now I want to remove the highlighted(yellow) recorded. 

 

Jared
Top achievements
Rank 1
Iron
 answered on 15 Mar 2023
0 answers
157 views

I'd like to dynamically increase the grid size (add rows and or columns) when a user attempts to paste data that exceeds the default size.

Is there an event that I can capture that fires before the 'Cannot paste, because the copy area and the paste area are not the same size and shape' error occurs?

I've tried OnClientChanging and OnClientPaste but the error is thrown before either of these events fire.

John
Top achievements
Rank 1
Iron
 asked on 15 Mar 2023
14 answers
1.3K+ views

I have a Radgrid on ASP.NET Form (RadControls for ASP.NET AJAX Q2 2012 SP2 with VS 2010) , which is bound to a Linq data source and set it to have 10 records per page , sorting, filtering is enabled. Also have a hyper a link column (Radgrid Mastertable Databound column) on the Radgrid, such that a user can click it & navigate to another external page (details.aspx) from the list.  I am passing Master Table Primary Key that is Parent key of all rows in Detail Page. On the details page, they have "Back" button to return to the RadGrid page.

I am looking for sample code snippet on the Server/Client Side on how to specify the page/row index to set the RadGrid after data binding. The idea is to ensure the user navigates to the same Radgrid (Parent) page/row index they were originally on after exiting from details.aspx.

Thanks

gc_0620

Rumen
Telerik team
 updated answer on 15 Mar 2023
14 answers
322 views

I get following error with RadMap:


[InvalidOperationException: Fehler während der Serialisierung oder Deserialisierung mit JSON-"JavaScriptSerializer". Die Länge der Zeichenfolge übersteigt den in der maxJsonLength-Eigenschaft festgelegten Wert.]
   System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj, StringBuilder output, SerializationFormat serializationFormat) +759618
   System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj, SerializationFormat serializationFormat) +103
   System.Web.Script.Serialization.JavaScriptSerializer.SerializeValue(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat, MemberInfo currentMember) +178
   System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj, StringBuilder output, SerializationFormat serializationFormat) +47
   Telerik.Web.UI.AdvancedJavaScriptSerializer.Serialize(Object obj) +102
   Telerik.Web.UI.RadMap.DescribeComponent(IScriptDescriptor descriptor) +54
   Telerik.Web.UI.ScriptRegistrar.GetScriptDescriptors(Control control) +180
   Telerik.Web.UI.RadDataBoundControl.GetScriptDescriptors() +9
   System.Web.UI.ScriptControlManager.RegisterScriptDescriptors(IScriptControl scriptControl) +164
   Telerik.Web.UI.RadDataBoundControl.RegisterScriptDescriptors() +153
   Telerik.Web.UI.RadDataBoundControl.Render(HtmlTextWriter writer) +122
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
   Telerik.Web.UI.ControlRenderer.Render(HtmlTextWriter writer) +148
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +169
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +169
   System.Web.UI.UpdatePanel.RenderChildren(HtmlTextWriter writer) +334
   System.Web.UI.UpdatePanel.Render(HtmlTextWriter writer) +58
   Telerik.Web.UI.OurUpdatePanel.Render(HtmlTextWriter writer) +264
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
   Telerik.Web.UI.PreControlToAjaxify.Render(HtmlTextWriter writer) +147
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +169
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +169
   System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +47
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +169
   System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +47
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +169
   System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +11661639
   System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +47
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
   System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +53
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +169
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +169
   System.Web.UI.Page.Render(HtmlTextWriter writer) +40
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
   Telerik.Web.UI.RadAjaxControl.RenderPageInAjaxMode(HtmlTextWriter writer, Control page) +1016
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +276
   System.Web.UI.Page.Render(HtmlTextWriter writer) +40
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4239

It seems  problem just occurs, when there are more then 3024 Markers on the map. Below this count there is now problem.

 

I allready changed the MaxJsonLength in the web.config. That changed nothing.


Versionsinformationen: Microsoft .NET Framework-Version:4.0.30319; ASP.NET-Version:4.8.4494.0

Chris
Top achievements
Rank 1
Iron
Iron
 answered on 14 Mar 2023
0 answers
204 views

Hello,

I am facing an issue wherein on the page following issue is coming:-

Request Failed. Try Again.

When I debugged the code then I found that the issue is actually coming due to this class file not found:- GanttProvider the actual error in the code is showing that:
The type or namespace name 'GanttProvider' could not be found (are you missing a using directive or an assembly reference?)


<%@ WebService Language="C#" Class="GanttService" %> using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Script.Services; using System.Web.Services; using System.Web.SessionState; //using Telerik.Web.UIusing Telerik.Web.UI.Gantt; [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. [System.Web.Script.Services.ScriptService] publicclassGanttService : System.Web.Services.WebService, IRequiresSessionState { private WebServiceController _controller; public WebServiceController Controller { get { if (_controller == null) { _controller = new WebServiceController(new GanttProvider()); } return _controller; } } [WebMethod(EnableSession = true)] public IEnumerable<CustomTaskData> GetTasks() { var ddd = Controller.GetTasks<CustomTaskData>(); var provider = new GanttProvider(); foreach (var item in ddd) { //item.Dependency = provider.GetSuccessorByTaskID((int)item.ID); item.Dependency = provider.GetPredecessorByTaskID((int)item.ID); } return ddd; } [WebMethod(EnableSession = true)] public IEnumerable<CustomTaskData> InsertTasks(IEnumerable<CustomTaskData> models) { var plannerRefId = HttpContext.Current.Session["GanttPlannerRefId"] != null ? Convert.ToInt32(HttpContext.Current.Session["GanttPlannerRefId"]) : 0; var plannerId = HttpContext.Current.Session["GanttPlannerID"] != null ? Convert.ToInt32(HttpContext.Current.Session["GanttPlannerID"]) : 0; var plannerType = HttpContext.Current.Session["GanttPlannerType"] != null ? HttpContext.Current.Session["GanttPlannerType"].ToString() : "project"; if (plannerType.Equals("vendor", StringComparison.InvariantCultureIgnoreCase)) { foreach (var item in models) { item.RootVendorID = plannerRefId; item.PlannerID = plannerId; } }else { foreach (var item in models) { item.ProjectID = plannerRefId; item.PlannerID = plannerId; } } return Controller.InsertTasks<CustomTaskData>(models); } [WebMethod(EnableSession = true)] public IEnumerable<CustomTaskData> UpdateTasks(IEnumerable<CustomTaskData> models) { var plannerRefId = HttpContext.Current.Session["GanttPlannerRefId"] != null ? Convert.ToInt32(HttpContext.Current.Session["GanttPlannerRefId"]) : 0; var plannerId = HttpContext.Current.Session["GanttPlannerID"] != null ? Convert.ToInt32(HttpContext.Current.Session["GanttPlannerID"]) : 0; var plannerType = HttpContext.Current.Session["GanttPlannerType"] != null ? HttpContext.Current.Session["GanttPlannerType"].ToString() : "project"; if (plannerType.Equals("vendor", StringComparison.InvariantCultureIgnoreCase)) { foreach (var item in models) { item.RootVendorID = plannerRefId; item.PlannerID = plannerId; } }else { foreach (var item in models) { item.ProjectID = plannerRefId; item.PlannerID = plannerId; } } return Controller.UpdateTasks<CustomTaskData>(models); } [WebMethod(EnableSession = true)] public IEnumerable<CustomTaskData> DeleteTasks(IEnumerable<CustomTaskData> models) { return Controller.DeleteTasks<CustomTaskData>(models); } [WebMethod(EnableSession = true)] public IEnumerable<DependencyData> GetDependencies() { return Controller.GetDependencies(); } [WebMethod(EnableSession = true)] public IEnumerable<DependencyData> InsertDependencies(IEnumerable<DependencyData> models) { return Controller.InsertDependencies(models); } [WebMethod(EnableSession = true)] public IEnumerable<DependencyData> DeleteDependencies(IEnumerable<DependencyData> models) { return Controller.DeleteDependencies(models); } [WebMethod(EnableSession = true)] public IEnumerable<Telerik.Web.UI.Gantt.ResourceData> GetResources() { return Controller.GetResources(); } [WebMethod(EnableSession = true)] public IEnumerable<AssignmentData> GetAssignments() { return Controller.GetAssignments(); } [WebMethod(EnableSession = true)] public IEnumerable<AssignmentData> InsertAssignments(IEnumerable<AssignmentData> models) { return Controller.InsertAssignments(models); } [WebMethod(EnableSession = true)] public IEnumerable<AssignmentData> UpdateAssignments(IEnumerable<AssignmentData> models) { return Controller.UpdateAssignments(models); } [WebMethod(EnableSession = true)] public IEnumerable<AssignmentData> DeleteAssignments(IEnumerable<AssignmentData> models) { return Controller.DeleteAssignments(models); } } [System.Runtime.Serialization.DataContract] publicclassCustomTaskData : TaskData { [System.Runtime.Serialization.DataMember] publicstring Description { get; set; } [System.Runtime.Serialization.DataMember] publicint? ProjectID { get; set; } [System.Runtime.Serialization.DataMember] publicint? PlannerID { get; set; } [System.Runtime.Serialization.DataMember] publicstring CusTaskType { get; set; } [System.Runtime.Serialization.DataMember] publicdouble? CusDuration { get; set; } [System.Runtime.Serialization.DataMember] publicdouble? CusActualHour { get; set; } [System.Runtime.Serialization.DataMember] publicint? VendorID { get; set; } [System.Runtime.Serialization.DataMember] publicstring Vendor { get; set; } [System.Runtime.Serialization.DataMember] publicint? RootVendorID { get; set; } [System.Runtime.Serialization.DataMember] publicstring RootVendorName { get; set; } [System.Runtime.Serialization.DataMember] publicstring ProjectName { get; set; } [System.Runtime.Serialization.DataMember] publicstring Dependency { get; set; } [System.Runtime.Serialization.DataMember] publicint? PlannerTaskID { get; set; } [System.Runtime.Serialization.DataMember] publicint? ItemRefID { get; set; } public override void CopyFrom(ITask srcTask) { base.CopyFrom(srcTask); Description = ((CustomTaskData)srcTask).Description; ProjectID = ((CustomTaskData)srcTask).ProjectID; PlannerID = ((CustomTaskData)srcTask).PlannerID; CusTaskType = ((CustomTaskData)srcTask).CusTaskType; CusDuration = ((CustomTaskData)srcTask).CusDuration; CusActualHour = ((CustomTaskData)srcTask).CusActualHour; VendorID = ((CustomTaskData)srcTask).VendorID; Vendor = ((CustomTaskData)srcTask).Vendor; RootVendorID = ((CustomTaskData)srcTask).RootVendorID; RootVendorName = ((CustomTaskData)srcTask).RootVendorName; ProjectName = ((CustomTaskData)srcTask).ProjectName; PlannerTaskID = ((CustomTaskData)srcTask).PlannerTaskID; ItemRefID = ((CustomTaskData)srcTask).ItemRefID; Dependency = ((CustomTaskData)srcTask).Dependency; } public override void CopyTo(ITask destTask) { base.CopyTo(destTask); ((CustomTaskData)destTask).Description = Description; ((CustomTaskData)destTask).ProjectID = ProjectID; ((CustomTaskData)destTask).PlannerID = PlannerID; ((CustomTaskData)destTask).CusTaskType = CusTaskType; ((CustomTaskData)destTask).CusDuration = CusDuration; ((CustomTaskData)destTask).CusActualHour = CusActualHour; ((CustomTaskData)destTask).VendorID = VendorID; ((CustomTaskData)destTask).Vendor = Vendor; ((CustomTaskData)destTask).RootVendorID = RootVendorID; ((CustomTaskData)destTask).RootVendorName = RootVendorName; ((CustomTaskData)destTask).ProjectName = ProjectName; ((CustomTaskData)destTask).PlannerTaskID = PlannerTaskID; ((CustomTaskData)destTask).ItemRefID = ItemRefID; ((CustomTaskData)destTask).Dependency = Dependency; } }

I am facing issue where I am trying to pass the object of GanntProvider class in WebServiceController constructor. It's an .ASMX file.

Kindly help me resolve this.

Thanks
Varun


Varun
Top achievements
Rank 1
 asked on 14 Mar 2023
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?