Telerik Forums
UI for ASP.NET MVC Forum
1 answer
306 views
I have a list view that has a change event.  When an item in my list view is selected how can I get the "key" that i set for the item instead of the text displayed?

<script type="text/x-kendo-tmpl" id="ItemTemplate">
  <div style="margin:5px;">
    #:ItemNo# - #:Description#<br />
  </div>
</script>
<%: Html.Kendo().ListView<ItemList>()
.Name("Items")<br>  .TagName("div"
 .DataSource(ds =>
     ds.Read(read => read.Action("ItemListRead", "Home"))
       .Model(m => m.Id(i => i.ItemKey)))
 .ClientTemplateId("ProjectItemTemplate")
 .Selectable(s => s.Mode(ListViewSelectionMode.Single))
 .Events(events => events.Change("onChange"))
%>

<script type="text/javascript">
   function onProjectItemChange(e) {
      var selected = $.map(this.select(), function (item) {
         return $(item).text();
      });
   }
</script>


Dimiter Madjarov
Telerik team
 answered on 29 Jul 2013
1 answer
147 views
I have a scheduler control on a page. 

Html.Kendo().Scheduler<TaskViewModel>()
    .Name("MyScheduler")
    .Date(DateTime.Now)
    .Height(600)
    .Views(views =>
    {
        views.DayView();
        views.WeekView(weekView => weekView.Selected(true));
    })
    .DataSource(dataSource =>
        dataSource.Model(m =>
        {
            m.Id(o => o.Id);
        })
        .ServerOperation(true)
        .Read(read => read.Action("ReadSchedules", "Scheduler"))
    )
    .Editable(false)
Nothing fancy,  For the purpose of testing out the control, i'm using the TaskViewModel from the example project. At my company we have people in India who will create recurring schedules on this calendar. When I save the schedule's date/time, i'm storing it as a UTC value (just like your example project). The problem occurs when a user here in the  U.S. (Central Standard Time) views a recurring (weekly with specified days) schedule. India would create a 9:30 AM IST, recurring every Tuesday & Thursday and the duration is for 2 hours. When an Indian user reads the data back, the scheduler displays it just fine. When a user in the U.S. (CST) views it, we should expect to see a recurring meeting at 11:00 PM CST on Monday and Wednesday. Instead, the meeting is showing up at 11:00 PM CST on Tuesday and Thursday. Not only is it showing up on the wrong day, but the event shows up on the scheduler as if the duration of the meeting as zero.

I also noticed something else, when I save the schedule, I am able to save the StartTimezone and EndTimezone to the database, however, these fields are not members of the ISchedulerEvent interface. The scheduler control seems to lose these values when it is repopulated with data. How is the client control supposed to know how to properly convert from one timezone to another without that information? 


Georgi Krustev
Telerik team
 answered on 26 Jul 2013
1 answer
141 views
Downloaded the Sample projects for getting started with ASP.NET MVC, JSP and PHP Kendo UI Wrappers.
The \wrappers-getting-started-master\aspnetmvc\aspnetmvc-episode4\aspnetmvc-episode4\ site grid has visual anomalies when clicking on the Edit button (row edit). See attached files for before and after clicking the Edit button.
Environment: All OS and other updates are up-to-date as of 07/24/13.

Thx, Ivan
Vladimir Iliev
Telerik team
 answered on 26 Jul 2013
1 answer
92 views
I am having all kinds of issues with the MVC Grid control.

When I try and page to the next page in the grid I get the raw data instead of the HTML page with the grid displayed..See attachment.

Second, I cannot, for the life of me, get the filtering nor the grouping function to work. When I click the filter icon, nothing happens.

I haven't even got to ALL of the CRUD functionality. This is so frustrating.

I am using the newest release of the Kendo UI toolset and Entity Framework 5. I have created the model from the EDMX.

Please help!
Vladimir Iliev
Telerik team
 answered on 26 Jul 2013
2 answers
139 views
As the subject suggests I'm attempting to alter body width to match the width of the grid in cases where the grid ends up bigger than the body.  I'm attempting to do that by wiring up the databound event of the grid and then setting the width of the body.  However, the grid's width is returning smaller than it actually is so the body is still left behind. 

For example, I have a min-width set on the body element in css.  In this case it's 1100px.  The grid is reporting its width as smaller than that min-width (1088), yet the grid goes well past that width on the screen.  Here is the javascript I am trying to use to accomplish this.  Any suggestions?

$(function () {
        var grid = $(gridNameForEditors).data("kendoGrid");
        grid.bind("dataBound", function () {
            var grid2 = $(gridNameForEditors);
            alert(grid2.width());
            document.body.style.width = grid2.width() + "px";
        });
    })
Dimo
Telerik team
 answered on 26 Jul 2013
2 answers
252 views
Having the following code (stripped down version):
@using (Html.BeginForm(@"Store", @"Admin", FormMethod.Post))
{
    @(Html.Kendo().Grid((IEnumerable<MyModel>) ViewBag.MyItems)
         .Name(@"grid")
         .Columns(columns =>
         {
             columns.Bound(pg => pg.Id).Visible(false);
             columns.Bound(pg => pg.Name).Template(
                      c => Html.ActionLink(c.Name, @"Details", new {id = c.Id}));
             columns.Command(
                      commands => commands.Destroy().Text("Delete")).Title("Delete");
         })
         .Pageable()
         .Sortable()
         .DataSource(
              dataSource => dataSource
               .Server()
               .Model(model => model.Id(p => p.Id))
               .Destroy(d => d.Action(@"Item_Destroy", @"Admin")))
         )
}
I do experience the following (wrong) behavior:
  1. User clicks the "Delete" button.
  2. The "Store" action of the "BeginForm" is being called, instead of the "Item_Destroy" action.
My question:

What have I done wrong in my view?

Uwe
Top achievements
Rank 1
 answered on 26 Jul 2013
12 answers
214 views
See screenshot.

It was working before the update (which I have since rolled back).

The grid itself doesn't even have filter enabled, why is it passing undefined at all, which is what Kendo is hanging up on I'm guessing....
Sebastian
Telerik team
 answered on 26 Jul 2013
1 answer
171 views
Hi,
I have a DropDownList that is initially binded on the server side with BindTo method (I am using DropDownListFor).
On the client (JS code) I need to clear its items and then repoppulate the control with other items.
What is the best practice to accomplish this?

Thanks,
Lauri
Petur Subev
Telerik team
 answered on 26 Jul 2013
1 answer
163 views
I have a kendo grid that that uses a ClientDetailTemplate to display a second sub-grid.  The sub-grid has a variety of commands that are in the toolbar, including a Kendo Upload control.  

The problem is that the Kendo control is surrounded in a div, so it breaks the single line appearance of my toolbar.  Is there any way to change the Upload control so that it can be used inline with other controls?

Thanks,
~Logan
Dimiter Madjarov
Telerik team
 answered on 26 Jul 2013
6 answers
171 views
After just downloading and upgrading to build 2013.1.319 - I now receive the following error when starting my app:

Microsoft JScript runtime error: Object doesn't support property or method 'live'

The error occurs in jQuery.unobtrusive-ajax.js (Asp.net mvc):

$("a[data-ajax=true]").live("click", function (evt) {
        evt.preventDefault();
        asyncRequest(this, {
            url: this.href,
            type: "GET",
            data: []
        });
    });

p.s. I am using the jquery.min.js that comes with the latest Kendo build.

Please advise. 
Brad Fulton
Top achievements
Rank 1
 answered on 25 Jul 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
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
Iron
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?