I want a toolbar item that open a kendo window with a custom action, without using any template...
I tried that:
...
.ToolBar(toolbar => toolbar.Create())
.Editable(editable => editable.Mode(GridEditMode.PopUp).Window(x => x.LoadContentFrom("MyAction", "MyController")))
...
Its not working... It always open a window with default Grid Model...
Thanks
You must use an editor template in order to customize the popup editor window of the grid. You can check this sample project that shows how to do the same: http://www.kendoui.com/code-library/mvc/grid/custom-popup-editor.aspx
Related
I have a Kendo MVC Grid that has the following edit and delete command buttons.
The code looks like this:
columns.Command(command => { command.Edit().Text(" "); command.Destroy().Text(" "); }).Width(86);
As you can see, the box each icon is in is way too big and takes up unnecessary space. I'd like to keep the icons but just shrink the space they consume. Can I do this?
I am using a Kendo UI Grid from MVC with ajax datasource. things are working fine, however I need to show some existing filters from database. For now, I am making a call from javascript for it setting by setting the filter object. However, it is making 2 requests, first without any filters and then with filters. I want to avoid double calls.
What I have tried.
I tried setting the AutoBind to false in Html helper for kendo grid but it gives error and doesn't load anything.
Secondldly, I tried setting the Filter while creating the kendo grid with html helper, but it doesn't reflect anything on UI.
#(Html.Kendo().Grid(Model.Students)
.Name("KendoGrid")
.Columns(columns =>
{
columns.Bound(e => e.FirstName).Width(Model.FirstName).HtmlAttributes(new { #class = "auto-ellipsis" });
})
.Read(read => read.Action("GetStudents", "Student").Data("BindStudents"))
)
I tried loading the loading the filters in code and applying them like
.Filter(filter=>filter.Add(x=>x.Firstname contains("Mike")))
but it doesn't have any effect on kendo grid in UI.
secondly I tried using the AutoBind(false) and it just gives an error and nothing loads on page.
I have a grid which opens a custom pop-up window
Editable(ed =>
ed.Mode(GridEditMode.PopUp).TemplateName("AddEditWorkOrder").Window(w
=> w.Resizable(r => r.MinWidth(1200).Enabled(true)).Title("Add Work Order"))
In the pop up i have a tab strip and some of the tabs have a grid inside. When I change the edit mode of some of them to
.Editable(ed => ed.Mode(GridEditMode.InLine))
the overview grid edit mode is set to inline edit, which is unacceptable. Do you have any clue how to set the inner grid to inline?
Im using kendo ui asp.net mvc Grid in my project.
is there a way to keep popup editor open when inserting new data?
Interesting question, made me want to try and implement this.
Attach an event handler to the Save event. This should be called when the 'update' button is clicked.
.Events(x => x.Save("SaveChanges"))
The event that closes the window is the dataBinding event of the grid so we are going to prevent that from happening.
function SaveChanges() {
alert("SaveChanges-Fired");
var grid = $("#GridName").data("kendoGrid");
grid.bind("dataBinding",function(e){
e.preventDefault();
})
}
I have got a grid, and added a Edit button to the top toolbar, and it has the pencil icon.
toolbar: [ "create", "edit", "save", "cancel" ]
However when I select a row and press it, no popup editor appears. But it does when i press the add button.
How can I do this?
Regards,
codeOwl
I thought this would be as easy as just adding the edit button, but apparently in the toolbar the edit button doesn't have a behavior. You can add it by using a toolbar template. Unless I'm missing something really obvious. It is terribly late.
http://jsbin.com/abayer/2/
try changing the way that you edit data:
.Editable(e => e.Mode(GridEditMode.InCell))
or
.Editable(e => e.Mode(GridEditMode.InLine))
or
.Editable(e => e.Mode(GridEditMode.PopUp))