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?
I currently am using buttons on my view for the menu. So along the top of my view I have
@(Html.Kendo().Button()
.Name("btnAddTeacher")
.HtmlAttributes(new { type = "submit", value = "AddTeacher", name = "Command", title = "Add Teacher" })
.ImageUrl(Url.Content("~/Images/add-student-35.png"))
.Enable(ElementaryProgress.Classes.Security.AllowSchoolEdit)
)
Now I would like to replace these buttons with a menu. However I can't seem to figure out how to pass the model within my routevalues in the call to the action. So my menu item looks like:
@(Html.Kendo().Menu()
.Name("menu")
.Items(items =>
{
items.Add()
.Text("Teacher")
.Items(c =>
{
c.Add()
.Text("Add Teacher")
.ImageUrl("~/Images/add-student-35.png")
.Enabled(ElementaryProgress.Classes.Security.AllowSchoolEdit)
.Action("EditMySchool", "School", new { vm=this.Model, Command="AddTeacher" });
});
})
)
So the problem is that when the call is made to my action on my controller, the parameter vm is null. So how do I set vm equal to the model on the view so that I can pass my viewmodel back to my controller?
Thanks in advance,
Lee
Hi There,
i have the following code. I'm wanitng the icon of the button to change eveytime you click the button deppening if the panel has expaneded or not. ("pin" and "unpin").
$("#button").kendoButton({
icon: "pin",
click: function (e) {
$('.UserFavouritesPanel').animate({ width: 'toggle' }, 350);
if ($('.UserFavouritesPanel').width()>1) {
$("#button").kendoButton({
icon: "unpin"
});
} else {
$(".UserFavouritesViewBtn").kendoButton({
icon: "pin"
});
}
}
});
The issue im having is that on the fist click the icon changes to the correct one but after that when you click the button it never changes again until you refresh the screen. Any ideas on why this happens.
In my model I have a nullable foreign key (DocumentCausalID) and the foreign object (DocumentCausal).
I'm using the default "GridForeignKey" editor template to choose the value using the DropDownList.
I've edited the default "GridForeignKey" adding the OptionLabel so I can choose a null value.
When I select the null value it update the row correctly, but the next time if I select a not-null value on the same row it doesn't work: it doesn't enter into the Update function of my controller.
Can you help me? (I've attached my Model, View and the Editor Template)
Thank you
Is there a way to bind the Grid to the results from a ADO.net reader without converting each row into a POCO object? We are trying to figure a way of allowing the end-users to add data from sql joins to the grid's data. So for example:
We have 3 tables: Parents, Students, Grades. A student can have multiple Parents (1..n) and multiple Grades (1..n). The default grid view should show only Students records but should allow the end user to add Parents to the grid so that each row shows parent/student combination.