I have a Telerik MVC Grid with server binding. I configure it to have an 'all' page size option. The page size selection works and when I pick 'all' it does show all the records but the selected page size value in the dropdown resets to default. Is this a bug or I'm doing something wrong? Is there a workaround for this? I've attached an example project (excluded Kendo components from the archive).
Thank you.
Nik
I have a grid that has a command edit , I would like to retrieve the new text in the events.Save("onEdit")) javascript.
I cannot see how to do this, and cannot locate any samples in the forms.
My current function and grid is below. How can I retrieve the data from the email address when the update button is selected in edit more.
function onEdit(e) {
e.preventDefault();
alert("save 1");
var grid = $("#siteManagementNotifications").data("kendoGrid");
var tr = $(e.target).closest("tr");
var data = this.dataItem(tr);
alert(data.emailAddress);
}
@(Html.Kendo().Grid<WebSite.Library.Models.SiteNotifications>()
.Name("siteManagementNotifications")
.Columns(columns =>
{
columns.Bound(p => p.siteId).Title("Id").Width(50).Hidden();
columns.Bound(p => p.siteNotificationId).Title("Id").Width(50).Hidden();
columns.Bound(p => p.siteNotification).Title("Type").Width(50);
columns.Bound(p => p.emailAddress).Title("Notification").Width(120).EditorTemplateName("TextBoxEditor");
//columns.Command(command => command.Custom("Save").Click("SaveSiteNotification")).Width(180);
columns.Command(command => { command.Edit(); }).Width(250);
})
.Events(events => events.Save("onEdit"))
.Editable(editable => editable.Mode(GridEditMode.InLine))
.NoRecords("No notifications exist.")
.DataSource(source => source
.Custom()
.Schema(schema => schema
.Model(m => m.Id(p => p.siteNotificationId)))
.Transport(transport => transport
.Read(read =>
{
read.Url("/Api/SiteInfo/_getNotifications/" + Model.SiteId)
.DataType("json");
})
))
)
I'm having trouble selecting the entire cell when editing a grid in InLine mode. I want the entire cell selected to make entering a new value easier.
I tried adding the onEdit event. But the onEdit event fires when the Edit button is clicked.
For grids that are batch edit, I've been able to have the onEdit event fire javascript to select the entire cell. This is how I'm doing it for a grid in batch mode. I assume it will be similar, but I'm struggling with it. Thanks for your help.
function onEdit(e) { var inputName = e.container.find('input').attr("name"); var myInput = e.container.find('input[name="' + inputName + '"]'); myInput.select(); }grid.dataSource.transport.options.read.url = "addr here"; grid.dataSource.read();
Hi,
I have an upload control that the validation is not working on. I am setting it to restrict to .jpg only and 2mb but the save action is called no matter what I upload to it.
@(Html.Kendo().Upload() .Events(e => e.Success("onParent1UploadSuccess")) .Async(a => a .AutoUpload(true) .Save("SaveParent1", "HistoryForm", new { AdmissionPK = Model.AdmissionPK }) ) .ShowFileList(false) .Multiple(false) .Name("Parent1Upload") .Validation(v => v .AllowedExtensions(new string[] { ".jpg" }) .MaxFileSize(2097152) ) .Messages(m => m.Select("Select File...")))
How do I get the validation to actually work?
Thanks.
I have some prices to display and edit in a Kendo UI Grid.
Prices ned to be shown (and edited) in nl-NL format. Prices are in double format.
The grid show it like: € 12,34. With a comma as separator. This is the correct format.
The I click on a cell to edit the price the edit cell display 12.34
- no currency symbol, which is not the main issue but would be great if this is also possible)
- displays with a point as decimal separator. When I change the value to 12.35 (with the same point separator as the edit box shows) it is stored as 1235.
- I need to edit the point as well and make it 12,35 (with the comma as separator). This behaviour is right btw, because we always edit with the comma as separator.
But the question is:
Why is the number displayed with a point as separator in the first place when I click on a cell. I need it there to display with the comma as a separator.
My code looks like the following:
ViewModel[DisplayFormat(DataFormatString = "{0:C}", ApplyFormatInEditMode = true)][Display(Name = "Price")]public double? price { get; set; }.cshtmlcolumns.Bound(c => c.price).Filterable(false).Width(100);@(Html.Kendo().Grid<PriceViewModel>().Name("grid").AutoBind(false) .Columns(columns => { columns.Bound(c => c.Id).Hidden();... columns.Bound(c => c.price).Filterable(false).Width(100);... })... .Editable(e => { e.Mode(GridEditMode.InCell); e.DisplayDeleteConfirmation(false); })... .DataSource(dataSource => dataSource .Ajax() .Batch(true) .ServerOperation(false) .PageSize(12) .Model(model => model.Id(c => c.Id)) .Read(read => read.Action("Read", "MaterialByClass").Data("getClassname")) .Model(model => { model.Id(p => p.Id); model.Field(p => p.code).Editable(false);... } ) .Update("Update", "MaterialByClass") .Destroy("Delete", "MaterialByClass") ))@section scripts{ @Scripts.Render("~/bundles/jquery-cookie") <script type="text/javascript"> $(document).ready(function () { kendo.culture("nl-NL");... }); </script>}Web.Config <system.web>... <globalization culture="nl-NL" uiCulture="nl" enableClientBasedCulture="true" />... </system.web>Hi,
I have the Problem that my form layout (Bootstrap) is not working in Kendo MVC Window but everywhere else...
(the Content is loaded with Ajax as an PartialView)
see attached Pictures:
I have set the following in my CSS:
*, :before, :after{ -webkit-box-sizing: content-box; -moz-box-sizing: content-box; box-sizing: content-box;}/* set a border-box model only to elements that need it */.form-control, /* if this class is applied to a Kendo UI widget, its layout may change */.container,.container-fluid,.row,.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1,.col-xs-2, .col-sm-2, .col-md-2, .col-lg-2,.col-xs-3, .col-sm-3, .col-md-3, .col-lg-3,.col-xs-4, .col-sm-4, .col-md-4, .col-lg-4,.col-xs-5, .col-sm-5, .col-md-5, .col-lg-5,.col-xs-6, .col-sm-6, .col-md-6, .col-lg-6,.col-xs-7, .col-sm-7, .col-md-7, .col-lg-7,.col-xs-8, .col-sm-8, .col-md-8, .col-lg-8,.col-xs-9, .col-sm-9, .col-md-9, .col-lg-9,.col-xs-10, .col-sm-10, .col-md-10, .col-lg-10,.col-xs-11, .col-sm-11, .col-md-11, .col-lg-11,.col-xs-12, .col-sm-12, .col-md-12, .col-lg-12{ -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;}Hi,
I am using a TreeList with "Load-on-Demand" approach due to large number of record (>5000). The tree is first loaded with the parent node and expanded accordingly. However, my problem is that only one record will get exported to Excel .
If I change to "Load-All" approach, exporting to Excel is fine if there is less than 2000 record. Once the record size goes over, the TreeList will fail to load.
Here is my Load-on-Demand code;
public JsonResult Read_AssemblyTreeList([DataSourceRequest] DataSourceRequest request, int? id)
{
var result = GetAssemblyPartList().ToTreeDataSourceResult(request,
e => e.AssemblyPartListID,
e => e.ParentSequence,
e => id.HasValue ? e.ParentSequence == id : e.ParentSequence == null,
e => e.ToAssemblyPartListVM());
return Json(result, JsonRequestBehavior.AllowGet);
}
Here is my Load-All code;
public JsonResult Read_AllAssemblyTreeList([DataSourceRequest] DataSourceRequest request)
{
var result = GetAssemblyPartList().ToTreeDataSourceResult(request,
e => e.AssemblyPartListID,
e => e.ParentSequence,
e => e.ToAssemblyPartListVM()
);
return Json(result, JsonRequestBehavior.AllowGet);
}
Any help is much appreciated.
Thanks
Karen
Hi,
I have one HTML editor, it becomes readonly when it is within Tabstrip. I have performed another experiment, just HTML editor within DIV without Tabstrip, everything is work as per normal.
I have made a comparison between them and found out it seem contenteditable="true" is missing in the body when it is placed within Tabstrip, may i know why and any to fix this? Comparison and implementation details are as below. Thanks.
HTML editor within Tabstrip
<html><head></head><body></body></html>
HTML editor outside Tabstrip
<html><head><meta charset="utf-8"><style>html,body{padding:0;margin:0;height:100%;min-height:100%;}body{font-size:12px;font-family:Verdana,Geneva,sans-serif;margin-top:-1px;padding:1px .2em 0;word-wrap: break-word;-webkit-nbsp-mode: space;-webkit-line-break: after-white-space;}h1{font-size:2em;margin:.67em 0}h2{font-size:1.5em}h3{font-size:1.16em}h4{font-size:1em}h5{font-size:.83em}h6{font-size:.7em}p{margin:0 0 1em;}.k-marker{display:none;}.k-paste-container,.Apple-style-span{position:absolute;left:-10000px;width:1px;height:1px;overflow:hidden}ul,ol{padding-left:2.5em}span{-ms-high-contrast-adjust:none;}a{color:#00a}code{font-size:1.23em}telerik\3Ascript{display: none;}.k-table{table-layout:fixed;width:100%;border-spacing:0;margin: 0 0 1em;}.k-table td{min-width:1px;padding:.2em .3em;}.k-table,.k-table td{outline:0;border: 1px dotted #ccc;}.k-table p{margin:0;padding:0;}k\:script{display:none;}</style><script>(function(d,c){d[c]('header'),d[c]('article'),d[c]('nav'),d[c]('section'),d[c]('footer');})(document, 'createElement');</script></head><body autocorrect="off" contenteditable="true"></body></html>
Code
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> <div> <% Html.Kendo().TabStrip() .Name("tabstrip") .Animation(animation => animation.Open(effect => effect.Fade(FadeDirection.In))) .Items(tabstrip => { tabstrip.Add().Text("Main") .Selected(true) .Content(() => { %> <%--This editor is not editable--%> <div class="row-fluid"> <div class="span12"> <label><%: Html.DisplayNameFor(model => model.Description) %>:</label> <%: Html.Kendo().EditorFor(model => model.Description) .Name("Description") .Encode(false) .Tools(tools => tools.Clear() .Bold() .FontColor().BackColor() .InsertUnorderedList().InsertOrderedList() .Outdent().Indent()) %> <%: Html.ValidationMessageFor(model => model.Description)%> </div> </div> <% }); }) .Render(); %> <%--This editor is work as normal--%> <label class="info-title"><%: Html.DisplayNameFor(model => model.Description) %>:</label> <%: Html.Kendo().EditorFor(model => model.Description) .Name("Description") .Encode(false) .Tools(tools => tools.Clear() .Bold() .FontColor().BackColor() .InsertUnorderedList().InsertOrderedList() .Outdent().Indent()) %> </div> </asp:Content>