Hi,
I have table which contains an ID column (Identity) and several other fields.
If I use "Inline" I can edit and add records.
The ID column is (as intended) not visible.
But a soon as I change to "Popup" the ID column shows up as edit field.
I changed the field to readonly via model.Field(p => p.ID).Editable(false);
Still I have an edit field for the ID - and I can change the value (although this is not persisitet to the DB).
So how to hide the column in Popup edit mode.
Manfred
We are working with “Jquery Kendo Grid” with asp.net MVC 4.0. We need your help on few things. Please help us with some samples.
View Code/ works fine if the value is picked from datepicker
<
div
class
=
"form-group"
>
@Html.LabelFor(model => model.StartDate, htmlAttributes: new { @class = "control-label col-md-2 k-label" })
<
div
class
=
"col-md-10"
>
@(Html.Kendo().DatePicker().Name("StartDate").Value(Model.StartDate).HtmlAttributes(new { style = "width:250px", onkeydown = "javascript:return false;", required = "required" }).Events(e => e.Change("startChange")))
@Html.ValidationMessageFor(model => model.StartDate, "", new { @class = "text-danger" })
</
div
>
</
div
>
<
div
class
=
"form-group"
>
@Html.LabelFor(model => model.EndDate, htmlAttributes: new { @class = "control-label col-md-2 k-label" })
<
div
class
=
"col-md-10"
>
@(Html.Kendo().DatePicker().Name("EndDate").Value(Model.EndDate).HtmlAttributes(new { style = "width:250px", onkeydown = "javascript:return false;" }).Events(e => e.Change("endChange")))
@Html.ValidationMessageFor(model => model.EndDate, "", new { @class = "text-danger" })
</
div
>
</
div
>
function startChange() {
var endPicker = $("#EndDate").data("kendoDatePicker"),
startDate = this.value();
if (startDate) {
startDate = new Date(startDate);
startDate.setDate(startDate.getDate() + 1);
endPicker.min(startDate);
}
}
function endChange() {
var startPicker = $("#StartDate").data("kendoDatePicker"),
endDate = this.value();
if (endDate) {
endDate = new Date(endDate);
endDate.setDate(endDate.getDate() - 1);
startPicker.max(endDate);
}
}
Hi,
I thought I'd ask on here first, but I am struggling to find any nice way to paste into the grid selected cells.
I am using multiple cell selection:
.Selectable(selectable => selectable.Enabled(true)
.Mode(GridSelectionMode.Multiple)
.Type(GridSelectionType.Cell))
I am anticipating I need to manually handle the paste event by registering for the paste event.
$(function () {
$("#weldgrid").bind("paste", function (e) {
var pastedText = undefined;
if (window.clipboardData && window.clipboardData.getData) {
pastedText = window.clipboardData.getData('Text');
} else if (e.clipboardData && e.clipboardData.getData) {
pastedText = e.clipboardData.getData('text/plain');
}
// TODO: Process input for tab/newlines
// iterate through selected cells
// write associated value to each one
}
}
I've come across this thread already which went dead after one response.
http://www.telerik.com/forums/copy-and-paste-rows-in-kendo-ui-asp-net-mvc-grid
For me the demo does not work and the API Docs in IE11 are all over the place. I am struggling to find my way around the layout/structure of the pages.
Now my question is, how can I nicely iterate through each cell in the range and set the value?
I can see that:
var grid = $("#grid").data("kendoGrid");
var currentSelection = grid.select();
currentSelection.each(function () {
// $(this) is the selected cell
}
Thanks
Andez
I have a simple model bound grid with Edit and Destroy commands with Inline editing set.
When I click on Edit, then Cancel, I expect the row to be exit out of editing mode and the row data stays the same.
However what I am seeing is the grid is deleting the row.
I have checked that no destroy methods are being called.
I've set up a grid with a required foreign key by creating a copy of the GridForeignKey editor template and adding .HtmlAttributes(new { required="required" }) and applying that editor template to the foreign key column.
This seems to work nicely however the validation message i get on the grid is "ClientID is required". How do i set this up to refer to the required field by its column title rather than the name in the model.
Thanks
Graeme
<
div
class
=
"field"
>
@Html.LabelFor(m => m.WeightUnitMeasureCode)
@(Html.Kendo().ComboBoxFor(m => m.WeightUnitMeasureCode)
.Filter(FilterType.Contains)
.Suggest(true)
.DataTextField("Name")
.DataValueField("Value")
.DataSource(source =>
{
source.Read(read =>
{
read.Action("GetUnitMeasures", "UiLists", new { area = "" });
});
})
)
</
div
>
After page load, clicking the down arrow on the control
opens the dropdown list but it is so long that it run out of view. (see image1)
If I select an item in the list and click the down arrow
again, the problem persists.
However, if I manually clear the text of the selected item
in the control, the dropdown opens automatically and it behaves as desired with
a max height of 200px (see image2)
The screenshots show that I'm using these in a custom modal window however this issue occurs even on a regular page.
Any ideas on what I’m doing wrong or how to fix this?