Telerik Forums
UI for ASP.NET MVC Forum
5 answers
320 views
Not matter what I try, I cannot get the template working when using ajax binding on a DropDownList() using Razor / MVC and EF.

The dropdownlist is getting the data properly from the json endpoint (returning a generic list of ef objects via json) but it's the drop down template that is not being generated properly.  I get "undefined" for data values in each item's option.

Have tried all kinds of things like:

.Template( " Employee Name : ${ data.empname }")

or

.Template( " Employee Name : ${ #=data.empname# }")

or

.Template( " Employee Name : #=data.empname# ")

and not matter what I try - i get

 "Employee Name:  undefined"

for each item.

Any help appreciated....
Rene
Top achievements
Rank 1
 answered on 17 Jan 2013
4 answers
350 views
Is there a way to make something editable only on create and not on edit in the editor?

To specify what I mean.

I would like different rules for editable depending on whether you have add new or edit old post. Some key fields cannot be edited once you done the initial create.
Nikhil
Top achievements
Rank 1
 answered on 17 Jan 2013
6 answers
945 views
Is it possible to specify page number somewhere in HTML helper so that grid's current page will be set to this specific page after loading? (I know it could be done by JavaScript without using HTML helpers, but it would be great to be able to do it in HTML helper)
Andrew
Top achievements
Rank 1
 answered on 17 Jan 2013
2 answers
125 views
Hello,

We are using Kendo grid to show records. We have a requirement of showing a textbox for a column when "Edit" button is clicked. This is working fine (in-built functionality provided by Kendo). However, when the "Create" button is clicked, the very same column needs to be replaced by an '<input type="file"....' so that the user is able to select a file from his machine. Any pointers on this will be really helpful.

Regards,
Nikhil
Nikhil
Top achievements
Rank 1
 answered on 17 Jan 2013
5 answers
302 views
Hi everyone,

I'm doing an ASP.NET MVC project with Kendo UI, and I've got a little problem.

I have a jquery script for re sizing my splitter.

window.onload = function () {
      $("#vertical").css("height", $(window).height());
};

But when I load my layout, I've got the good size, but not the good display. (1.png)

If I hide my bottom splitter , and then show it, it's the well display (2.png)

Thanks all for you answers :)
Dimo
Telerik team
 answered on 17 Jan 2013
1 answer
530 views
How do I change the text of the "Cancel changes" button on a toolbar of a grid?


Regards,
Jan Erik
Iliana Dyankova
Telerik team
 answered on 17 Jan 2013
4 answers
235 views
I am trying to conditionally format a column of booleans to display "Yes" if true and "No" if false.  I am following the example here, but it is not working.  Regardless of the values in my "IsEnabled" column, it displays the same thing for every column.  In the case below, it displays "Yes" for every row in the column even though "IsEnabled" is false. Please advise. Thanks.

columns.Bound(n => n.IsEnabled)
             .Width(100)
             .ClientTemplate(
                "# if (IsEnabled) { #" + "Yes" +
                "# } else { #" + "No" + "#}#");
Francois
Top achievements
Rank 1
 answered on 16 Jan 2013
1 answer
215 views
I want to implement master - details concept in asp.net mvc with kendoui.

Basically I have one mvc view to capture master record info. In the same view I want to add multiple detail records using kendo grid (like invoice).

I have successfully achieved the master entry part but details are not saved. I have checked the controller action method the child entities are not added in the master entity. It always shows as empty list.

I am using EF 5 and MVC 4 with Unit Of Work pattern. I am new to these technologies. I would appreciate if someone help to solve this problem.
Daniel
Telerik team
 answered on 16 Jan 2013
6 answers
227 views
Hello, 

We would like to use Aggregates with ListView. We have been able to get it working with Grid but not ListView.

<script type="text/x-kendo-tmpl" id="template">
    <div class="product">
        <img src="@Url.Content("/")${ImagePath}.jpg" alt="${Name} image" />
        <h3>${Name}</h3>
        <dl>
            <dt>Price:</dt>
            <dd>${kendo.toString(Price, "c")}</dd>
            <dt><input type="button" value="Remove"/></dt>
        </dl>
    </div>
    <div>
        <h3>Total price: ?????</h3>
    </div>
</script>
 
@(Html.Kendo().ListView<SixthCoffee.Web.ViewModels.CartItem>()
    .Name("CartList")
    .TagName("div")
    .ClientTemplateId("template")
    .DataSource(dataSource => {
        dataSource.Read(read => read.Action("AjaxCartGrid_Read", "MenuSurface"));
        dataSource.Aggregates(aggregates =>
            {
                aggregates.Add(s => s.TotalPrice).Sum();
            });
    })
             
)
Any help will be greatly appreciated.

Thanks,
Padmaja
Nikolay Rusev
Telerik team
 answered on 16 Jan 2013
6 answers
370 views
Hi,

I'm having this problem that only happens in a particular situation. If I have a grid with only one row and I try to delete it, there is a javascript error here.

l._current.closest("table")[0].focus()
Unhandled exception at line 16, column 31418 in http://localhost/zzz/Scripts/kendo/2012.3.1114/kendo.web.min.js
0x800a138f - Microsoft JScript runtime error: Unable to get value of the property 'closest': object is null or undefined

When there is more than one row on the grid, deletes work perfectly fine. I believe it might have to do with the grid trying to set focus to the closest row available...when there are no rows available at all. This is what I'm using to generate the grid. Thanks in advance.

@(Html.Kendo().Grid<MyNamespace.MyModel>()
      .Name("myGrid")
      .Columns(columns =>
      {
          columns.Bound(c => c.Name);
          columns.Command(c =>
          {
c.Edit();
               c.Destroy();           });       })       .ToolBar(toolbar => {             toolbar.Create();             })       .Sortable()       .Selectable()       .Reorderable(r => r.Columns(true))       .Resizable(r => r.Columns(true))       .Navigatable()       .Filterable()       .Scrollable(scroll => scroll.Height(500))       .Editable(editable => editable.Mode(GridEditMode.InLine))       .DataSource(dataSource => dataSource         .Ajax()         .Read(read => read                     .Type(HttpVerbs.Get)                     .Url(Url.RouteUrl("DefaultApi"new { httproute = "", controller = "mycontroller" }))              )         .Create(create => create                     .Type(HttpVerbs.Post)                     .Url(Url.RouteUrl("DefaultApi"new { httproute = "", controller = "mycontroller" }))              )         .Update(update => update                     .Type(HttpVerbs.Put)                     .Url(Url.RouteUrl("DefaultApi"new { httproute = "", controller = "mycontroller" }))              )         .Destroy(destroy => destroy                     .Type(HttpVerbs.Delete)                     .Url(Url.RouteUrl("DefaultApi"new { httproute = "", controller = "mycontroller" }))              )         .Model(m => {                     m.Id(c => c.Id);                     }                )         .ServerOperation(false)) )

UPDATE: Since it was apparently just trying to find a row to focus, I added a check to see if the object was null. I wrapped
the call like this.
function(){if(l._current)l._current.closest("table")[0].focus();}

Seems to be working now for both a single row on the grid or multiple rows. Hope this gets fixed in a future release.
OmarOrnelas
Top achievements
Rank 1
 answered on 15 Jan 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?