I've got a webapp already running fine and I've been thinking about adding scheduler. What would be the easiest way to implement it? My data will be on a sql database.
Thanks in advance
Hi,
Is there a way to set color on the value for some fields according to some rule? yes/no or >0, <0.
Hi,
I want to get the filters from the grid to perform server side filtering. Is this possible with your grid and RazorPages?
I want to show a lot of logmessages, that have to be filtered on the database, because i would load to many records.
Best Regards
Moritz
Hi all,
I'm looking to cleanse data exported from a Kendo Grid to an Excel Spreadsheet and I've not yet been able to find any way of doing this using the available Kendo Grid functions.
Does anyone know of a way to manipulate data exported from a Grid, before it's pushed into an Excel spreadsheet?
For example, I'm looking to escape Excel formula characters to make sure malicious code is not run on a client machine, when they open up an Excel spreadsheet (which has been filled with exported grid data). I need to replace characters such as equal to (=), plus (+), etc.
I'm currently using the Telerik.UI.for.AspNet.Core (2019.2.514) nuget package.
Many thanks in advance,
John
The documentation found here has some formatting issues that makes it quite hard to read. Look at the IndexController.cs tab:
https://demos.telerik.com/aspnet-core/grid/index
Also, by convention the file name should be the same as the class name. Therefore, the tab should be renamed as GridController.cs
I stepped through this process because my Grid would not show up. After the process... it still wouldn't show up:
https://docs.telerik.com/aspnet-core/getting-started/getting-started-copy-client-resources
So, then I used the Telerik Extension to create a project. After reviewing the template I see that pretty much nothing in this start up instruction is there. I the article obsolete? If so, please update it.
i already install telerik
and by nuget from commercial download link
but still got problem
do you have any idea?
thank you
Hi,
Ok, so I have a grid, strangely enough called "grid". On it I have .Editable(e => e.Mode(GridEditMode.InCell) set. Everything works great. My data annotations do their job and catch errors. However, one of the columns has a unique index on it. I catch duplicate errors in a try/catch block on the server when they hit save. I add a Model error, but nothing is displayed.
The error message never shows. What am I missing?
Thanks … Ed
@(Html.Kendo().Grid<
RoomsModel.RoomModel
>()
.Name("grid")
.ToolBar(t =>
{
t.Create().Text("Add New"); t.Save().Text("Save Changes");
})
.HtmlAttributes(new { style = "height: 650px;" })
.Editable(e => e.Mode(GridEditMode.InCell) //.TemplateName("RoomEditTemplate")
.Window(w => w.Title("Room").Width(650)))
.Columns(columns =>
{
columns.Bound(t => t.Id).Visible(false);
if (((IEnumerable<
Property
>)ViewData["Properties"]).Count() > 1)
{
columns.ForeignKey(t => t.PropertyId, (System.Collections.IEnumerable)ViewData["Properties"],
"Id", "PropertyName").Width(125);
}
columns.Bound(c => c.RoomNumber).Title("Room Number").Width(125);
columns.Bound(c => c.RoomName).Title("Room Name").Width(120);
columns.Command(command =>
{
//command.Edit().Text("Edit/View Details");
command.Destroy();
}).Width(150);
})
.HtmlAttributes(new { style = "margin-left:3px" })
.Resizable(resize => resize.Columns(true))
.Selectable(s => s.Mode(GridSelectionMode.Single).Type(GridSelectionType.Row))
.Scrollable()
.Filterable()
.Sortable()
.Pageable() //p => { p.PageSizes(true); })
.DataSource(ds =>
ds.Ajax()
.Batch(true)
.Events(ev => ev.Error("errorHandler"))
.Read(r => r.Url("?handler=RoomsRead").Data("forgeryToken"))
.Update(u => u.Url("?handler=RoomsUpdate").Data("forgeryToken"))
.Create(c => c.Url("?handler=RoomsCreate").Data("forgeryToken"))
.Model(m =>
{
m.Id(t => t.Id);//.Editable(false);
})
.PageSize(10)
)
)
public IActionResult OnPostRoomsCreate([DataSourceRequest] DataSourceRequest request,
[Bind(Prefix = "models")]IEnumerable<
RoomsModel.RoomModel
> Rooms)
{
Room rm;
List<
RoomModel
> lstResults = new List<
RoomModel
>();
if (ModelState.IsValid)
{
try
{
using (TransactionScope oScope = new TransactionScope())
{
if (Rooms != null && ModelState.IsValid)
{
foreach (var r in Rooms)
{
rm = new Room();
rm.RoomName = r.RoomName;
.
.
.
_db.Rooms.Add(rm);
_db.SaveChanges();
RoomModel rmm = new RoomModel();
rmm.Id = rm.Id;
.
.
.
lstResults.Add(rmm);
}
}
oScope.Complete();
}
}
catch (Exception ex)
{
var sqlException = ex.InnerException as SqlException;
if (sqlException != null && sqlException.Errors.OfType<
SqlError
>()
.Any(se => se.Number == 2601 || se.Number == 2627 /* PK/UKC violation */))
{
StatusMessage = "Error: Room number already used.";
ModelState.AddModelError("RoomNumber", StatusMessage);
return new JsonResult(new[] { lstResults.ToDataSourceResult(request, ModelState) });
}
}
}
return new JsonResult(new[] { lstResults.ToDataSourceResult(request, ModelState) });
}