Hello,
can be hidden Saturdays and Sundays from the scheduler control in all views and how?
Many thanks!
I am looking for a sample of a responsive pie chart. I have tried different suggestions from the forums but none seem to work. Is there a fully worked sample I can reference?
I have a situation where certain users should be able to view data in a grid, but not be able to edit it. It looks like there are ways to disable individual elements of the grid, but is there a way to make it entirely readonly?
[edit: of course as soon as I finished typing this a co-worker made a suggestion that works. Simply putting the grid in a div with the class k-state-disabled does the trick]
I have grid, which has a boolean column, I want after page loading, to show only records with true value of the boolean column. I'm using row filtering, and I also want to show filter controls for this column activated on true value. I turned off server operations.
Hello,
I am letting users to upload a pdf file on the browser. Once the user upload the file, I want to give them the option to view the uploaded file. In order to upload the file, I am using ASP.NET Core Upload Asynchronous Upload control and it works fine, but I am not sure how can I have the user view the pdf file as soon as it uploads. The files exists on server. Below is my entire code:
@using Kendo.Mvc.UI
<div style="margin-top:60px">
<div>
<span style="font-size:20px; font-weight:bold">Upload File</span>
</div>
<br /> <br />
<div class="block-section">
@(Html.Kendo().Upload()
.Name("files")
.Async(a => a
.Save("Async_Save", "Block")
.Remove("Async_Remove", "Block")
.AutoUpload(true)
)
)
</div>
below is my controller code:
public async Task<IActionResult> Async_Save(IEnumerable<IFormFile> files)
{
foreach (var file in files)
{
var fileContent = ContentDispositionHeaderValue.Parse(file.ContentDisposition);
var fileName = Path.GetFileName(fileContent.FileName.ToString().Trim('"'));
var physicalPath = Path.Combine(_webHostEnvironment.WebRootPath, "UploadedFiles", fileName);
using (var fileStream = new FileStream(physicalPath, FileMode.Create))
{
await file.CopyToAsync(fileStream);
}
}
return Content("");
}
The file that is uploaded by the user using the above control, I want the user to see that file. I know Telerik has pdfViewer, but I am not sure how the pdfViewer can show the file that exists on the server. The files is uploaded and saved on a folder in wwwRoot. i dont know the name of the file. Below is what I am trying to use:
<div>
@(Html.Kendo().PDFViewer().Name("pdfviewer")
.PdfjsProcessing(pdf => pdf.File(Url.Content("~/wwwroot/UploadedFiles/2020-0598857.pdf")))
.Height(1200)
)
</div>
Hello,
where can I find the controller code for ASP.NET Core Upload Asynchronous Upload. Somehow when I trying to upload my file, I keep getting an error "failed to upload the file". below is what i have in my controller:
public ActionResult Async_Save(IEnumerable<IFormFile> files)
{
// The Name of the Upload component is "files"
string path = Path.Combine(_webHostEnvironment.WebRootPath, "FileSavePath");
string DestinationPath = _configuration["DestinationPath"].ToString();
if (files != null)
{
MoveFiles mf = new MoveFiles();
foreach (var formFile in files)
{
using (var stream = System.IO.File.Create(DestinationPath))
{
formFile.CopyTo(stream);
}
}
}
This is my cshtml code:
any help will be apprecaited.
@using Kendo.Mvc.UI
<div style="margin-top:60px">
<div class="block-section">
@(Html.Kendo().Upload()
.Name("files")
.Async(a => a
.Save("Async_Save", "Upload")
.Remove("Async_Remove", "Upload")
.AutoUpload(true)
)
)
</div>
</div>
The form throws this exception when a User has Department. View with form:
@model DMDPace.DataAccess.DomainModels.User;
@(Html.Kendo().Form<User>()
.Name("User")
.HtmlAttributes(new { action = "/Directory/User_Update", method = "POST" })
.Layout("grid")
.Grid(g => g.Cols(12).Gutter(20))
.Items(i =>
{
i.Add().Field(e => e.DepartmentId).Label("Отдел").Editor(e => e.DropDownList()
.DataTextField("Name")
.DataValueField("Id")
.DataSource(s =>
{
s.Read(r => r.Action("GetDepartments", "Home"));
}));
}))
When I comment form code, it runs without errors.
User:
public class User : Entity
{
public int? DepartmentId { get; set; }
public Department Department { get; set; }
}
Department:
public class Department : Entity
{
public virtual List<User> Users { get; set; }
}
Startup:
services.AddControllers().AddNewtonsoftJson(options =>
{
options.SerializerSettings.ContractResolver = new DefaultContractResolver();
options.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;
});
Endpoint which returns view:
[HttpGet("[controller]/User/{Id:int}")]
public async Task<IActionResult> UserView(int id)
{
var entity = await _userObjectService.GetAll()
.Include(e => e.Department)
.Where(e => e.Id == id)
.FirstOrDefaultAsync();
return View("User", entity);
}
Telerik version - 2022.1.301.
I have a dropdown editor in the partial view:
@(Html.Kendo().DropDownListFor(m => m.DepartmentId)
.DataTextField("Name")
.DataValueField("Id")
.DataSource(source =>
{
source.Read(read =>
{
read.Action("GetDepartments", "Home");
});
})
)
Which I use in grid by specifying partial view's file name:
.EditorTemplateName("Department")