Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting the width of Kendo UI Grid Popup (MVC)

I'm using the MVC Wrappers of Kendo UI and I cannot set the width of the popup. I've tried two methods and none are working. Here's what I've tried:

.Editable(edit => edit.Mode(GridEditMode.Popup)
    .TemplateName("Create")
    .Window(w => w.Title("Add Interruption")
        .Name("addInterruption")
        .Width(700)))

and

.Editable(edit => edit.Mode(GridEditMode.Popup)
    .TemplateName("Create")
    .Window(w => w.Title("Add Interruption")
        .Name("addInterruption")
        .HtmlAttributes(new { style="width:700px;" })))

Height doesn't work either.

How do you set the width of the popup window? Thanks!

UPDATE: For anyone else struggling with this, here's the fix:

.k-edit-form-container { width: auto;}

This is found in the kendo.common.min.css file.

like image 371
Buster Avatar asked Nov 14 '12 14:11

Buster


Video Answer


1 Answers

Sadly the Settings you applied in both of your snippets are not serialized and not applied to the window at all when using Ajax binding (not even sure about Server Binding).

Basically to set the Width I suggest you to use the following JavaScript when the page has loaded:

$("#NameOfTheGrid").data().kendoGrid.options.editable.window.width = "1000px";
like image 80
Petur Subev Avatar answered Oct 21 '22 17:10

Petur Subev