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.
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.
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.
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
|
[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
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
Hi all,
I have 2 RadGrid.
When a row is selected on the first Radgrid and if the second RadGrid contain only one value (after populating it) =>
I can from the code behind of the first RadGrid select the first and only row of the second via the code behind (OnSelectedIndexChanged event on the first Radgrid).
RadGrid2.MasterTableView.Items[0].Selected = true;
But the JS code <ClientEvents OnRowSelected="RowSelected"/> of the second is never called.
If I click on the row, the JS event is called correctly.
I try via a call =>
ScriptManager.RegisterStartupScript(this.Page, GetType(), "Selected", "RowSelected()", true);
But without succes => get an error =>
Uncaught TypeError: Cannot read properties of null (reading 'get_masterTableView')
Any suggestion ?
Regards,
Didier
Hello,
I am trying to upload file to S3Bucket and after being uploaded needs to move it to a subfolder under the bucket.
Is there any automatic proccess to upload directly to a S3Bucket/UserID folder?
or we have to create the sub folder first?
Thanks
Michel
Hi, i try to export data table to excel file using following code https://docs.telerik.com/devtools/aspnet-ajax/knowledge-base/common-export-large-amount-of-data-to-pdf-xlsx-and-csv-using-the-telerik-document-processing-libraries?_ga=2.266990472.785509911.1678626449-162692405.1645090225&_gl=1*1ns64vr*_ga*MTYyNjkyNDA1LjE2NDUwOTAyMjU.*_ga_9JSNBCSF54*MTY3ODY3Nzk2OS4xMTguMS4xNjc4Njc4MzQwLjM1LjAuMA.. , in data table we have number columns which is not export correct format ,we need to change format for apply formulas, we need to avoid this, bcz each time need to change that format in order to sum the column,
Private Sub SpreadStreamProcessingForXLSXAndCSV(ByVal dt As DataTable, ByVal filename As String, ByVal Optional docFormat As SpreadDocumentFormat = SpreadDocumentFormat.Xlsx, ByVal Optional sheetName As String = "Sheet1") If dt Is Nothing Then Dim manager As RadAjaxManager = RadAjaxManager.GetCurrent(Page) manager.Alert("No records to export to excel!") Exit Sub End If Using stream As MemoryStream = New MemoryStream() Using workbook As IWorkbookExporter = SpreadExporter.CreateWorkbookExporter(docFormat, stream) Using worksheetExporter As IWorksheetExporter = workbook.CreateWorksheetExporter(sheetName) For i As Integer = 0 To dt.Columns.Count - 1 Using columnExporter As IColumnExporter = worksheetExporter.CreateColumnExporter() columnExporter.SetWidthInPixels(100) End Using Next ExportHeaderRows(worksheetExporter, dt) For Each row As DataRow In dt.Rows Using rowExporter As IRowExporter = worksheetExporter.CreateRowExporter() For Each item In row.ItemArray Dim normalFormat As SpreadCellFormat = New SpreadCellFormat() normalFormat.FontSize = 10 normalFormat.VerticalAlignment = SpreadVerticalAlignment.Center normalFormat.HorizontalAlignment = SpreadHorizontalAlignment.Center Using cellExporter As ICellExporter = rowExporter.CreateCellExporter() cellExporter.SetValue(item.ToString()) cellExporter.SetFormat(normalFormat) End Using Next End Using Next End Using End Using Dim output As Byte() = stream.ToArray() If docFormat = SpreadDocumentFormat.Csv Then FileExtension = "csv" filename = filename ContentType = "text/csv" ElseIf docFormat = SpreadDocumentFormat.Xlsx Then FileExtension = "xlsx" filename = filename ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" End If WriteFileToResponse(output, filename) End Using End Sub Private Sub ExportHeaderRows(ByVal worksheetExporter As IWorksheetExporter, ByVal dt As DataTable) Using rowExporter As IRowExporter = worksheetExporter.CreateRowExporter() Dim HeaderRowHeight As Double = 50 rowExporter.SetHeightInPoints(HeaderRowHeight) Dim format As SpreadCellFormat = New SpreadCellFormat() format.IsBold = True format.Fill = SpreadPatternFill.CreateSolidFill(New SpreadColor(142, 196, 65)) format.ForeColor = New SpreadThemableColor(New SpreadColor(255, 255, 255)) format.HorizontalAlignment = SpreadHorizontalAlignment.Center format.VerticalAlignment = SpreadVerticalAlignment.Center For i As Integer = 0 To dt.Columns.Count - 1 Using cellExporter As ICellExporter = rowExporter.CreateCellExporter() cellExporter.SetFormat(format) cellExporter.SetValue(dt.Columns(i).ColumnName) End Using Next End Using End Sub Private Sub WriteFileToResponse(ByVal content As Byte(), ByVal strfilename As String) Response.ContentType = ContentType Response.Headers.Remove("Content-Disposition") Response.AppendHeader("Content-Disposition", String.Format("attachment; filename={0}.{1}", strfilename, FileExtension)) Response.BinaryWrite(content) Response.[End]() End Sub
Is there a way to hide/unhide tabs(sheets) of a RadSpreadsheet control?
In Excel, one can simply right-click the tab and select to hide or unhide it.