Telerik Forums
UI for ASP.NET MVC Forum
1 answer
2.0K+ views
I have a ListView which gets json data from the MVC controller action like below:

@(Html.Kendo().ListView<recordLayout>()
    .Name("GridCustomFormResults")
    .TagName("div")
    .ClientTemplateId("templateItem")
    .DataSource(dataSource => dataSource
      .Events(x => x.Error("handleAjaxError"))
      .Read(read => read.Action("Search_ListRead1", "Forms").Data("getFormRecordData"))
    )
)

The returned json has a array "fields".
In the list view I want to create a template which loops through the fields collection and display a list or table in the template like below: 
"fields.name" : "fields.value" 
"fields.name" : "fields.value" 
"fields.name" : "fields.value" 
"fields.name" : "fields.value" 
etc....

Basically I dont know the syntax of how to loop through the fields collection in the template?


The json follows this format:

{
  "fields": [
    {
      "oid": "2C3E8771-1088-4CBC-A51B-1770F6FED377",
      "fieldDefOid": "E8718D13-152D-431D-BAA7-D25F0EE9873D",
      "name": "House Number",
      "value": "1"
    },
    {
      "oid": "F1D578DC-620F-4C43-8F1F-280970789A08",
      "fieldDefOid": "62A7BF60-C5AB-4E5B-9051-D263A23B26E4",
      "name": "Title",
      "value": "The Big Games"
    },
    {
      "oid": "50EDCECD-BBD0-43F6-A4C4-375B9A6A2D06",
      "fieldDefOid": "8729DB86-9FA3-4EFD-B68B-E8DFDC85B6D2",
      "name": "My Date",
      "value": "12 September 2010"
    }
  ],
  "oid": "6351A960-0815-4AED-9A51-653CA9E03BB2",
  "recordTypeOid": "D650D0BC-F312-4D97-A226-6F79AE84FF31"
}







Ruairi
Top achievements
Rank 1
 answered on 22 Jan 2015
1 answer
121 views
Using date pickers I need to format as dd-MM-yyyy, but when posting to server I need to post as yyyy-MM-dd
using ajax I can do this using "FromDate": kendo.toString($("#FromDate").data("kendoDatePicker").value(), "yyyy/MM/dd")

but when using the MVC wrappers in a form how can I send to server as yyy-MM-dd?

Thnaks
Georgi Krustev
Telerik team
 answered on 21 Jan 2015
2 answers
388 views
Hi All,

I have simple ASP.NET MVC web application to fetch data from SQL DB from controller and render it to a web application using Kendo grid.
Performance before we started to use Kendo controls was fine and renders the page quickly. The issue of slow performance started only after we decided to use Kendo grid for sorting and filtering. Even the page without any kendo controls takes more time to load.

Following is the code in our CSHTML page. Any quick help will be greatly appreciated.

    @using (Html.BeginForm("ReplaySelectedInboundMessages", "Home"))
   {
    <div id="gridContent1">
        <h1>All Messages</h1>  
    @(Html.Kendo().Grid<VPath.MessageReplay.MvcApp.Models.LogModel>(Model)
    .Name("grid")  
    .HtmlAttributes(new { style = "height:430px;" })  
    .Columns(columns => 
        {
            columns.Template(@<text><input class="box"  id="assignChkBx"name="assignChkBx" type="checkbox" value="@item.LogID"/></text>).HeaderTemplate(@<text><input type='checkbox' id='allBox' onclick='toggleSelection()'</text>).Width(20);
            columns.Bound(p => p.LogID).Template(p=> Html.ActionLink(((string)p.LogID), "MessageDetails", new { logid = p.LogID})).Width(200);
            columns.Bound(p => p.ReceivePortName).Width(100);
            columns.Bound(p => p.SendPortName).Width(100);
            columns.Bound(p => p.loggedDate).Width(100);
            columns.Bound(p => p.ControlID).Width(100);
            columns.Bound(p => p.SenderID).Width(100);
            columns.Bound(p => p.ReceiverID).Width(100);
            columns.Bound(p => p.InterchangeID).Width(100);
            columns.Bound(p => p.ReplayedCount).Width(100);
            columns.Bound(p => p.RetryCount).Width(100);
            columns.Bound(p => p.AckCode).Width(20);
        })        
        .Filterable()   
        .Pageable()
        .Sortable()
        .Scrollable(src => src.Height(430))        
        .Resizable(resize => resize.Columns(true))
        
        )
         <br />
        <br />
        <input type="Submit" name="btnReplayMessage" value="Replay" title="Replay Message" \>
</div>  
    }




Rohit
Top achievements
Rank 1
 answered on 21 Jan 2015
2 answers
128 views
Hi all,

I've tried to create detail template using this link http://demos.telerik.com/aspnet-mvc/grid/detailtemplate
and modified a little so i can add grid inside it, so basically my grid structure look like this :
> Parent Grid
     >Child Grid


but right now, whenever i use editor template, the input column looks weird (i tried with editor template for datepicker)
I was looking for solution everywhere but couldn't found the answer yet :(

and i attached some images about my application.
Nikolay Rusev
Telerik team
 answered on 21 Jan 2015
2 answers
159 views
Hi,

I am not sure there have been threads about this issue before. I could not find anything quickly. I am planning to use Telerik hosted within a standard COTS application by means of an IFrame. I have limited possibilities to change the standard application (because, well it is a bad practice for a COTS application). The browser is IE9 which is a company standard and I am not able to change that too. The problem is that the standard host application forces the browser in Quirks mode and if I change that to standard (strict) mode (e.g. by means of an http header setting X-UA-Compatible to IE=edge) other things breaks for obvious reasons (IFrame height set to "100%" now interpreted as 100 pixels, font resizing issue probably caused by the box model interpretation, etc.).

What is my best option to have Telerik controls working correctly in this scenario? Some things just don't seem to work for no obvious reason even in IE9 strict mode, such as selecting an item from a dropdown list in a custom popup editor in a grid using the MVC Html.DropDownListFor. For example, I can click on an item in the drop-down list but it does not get selected. There might be other issues I might ran into. To get a feeling about whether I will be able to make this scenario work at all I would like to have some advice from Telerik support and others from this forum.

To summarize I have these questions:
1. What are my chances to make the Telerik controls (UI forASP.NET MVC) work together with the standard MVC controls in this scenario?
2. What are some features I should avoid or issues I should be aware of? Are there any workarounds for them?
3. Except from some styling and sizing issues the standard host application seem to work fine. I might be able to fix things there but some references on how to fix things would be great (I am already exploring stackoverflow, quirtksmode.org, MDN, w3fools, etc.). I guess I am looking for something like a cookbook on migrating from quirks to strict mode. Any good pointers would be greatly appreciated.

Thanks in advance for any help.

Marc
Marcus Spieka
Top achievements
Rank 1
 answered on 20 Jan 2015
1 answer
225 views
After upgrading Kendo UI 2014 Q3 to Kendo UI 2014 Q3 SP1, I found a problem in my project, with visibility of TITLE of Navigation Bar.
Using inspector, I can see the next difference in the generated html code:

After update
<div class="km-view-title km-hide-title">
  <span data-role="view-title">Title</span>
</div>

Before the update
<div class="km-view-title">
   <span data-role="view-title">Title</span>
</div>

The problem is solved applying 'display:block' to 'km-view-title' class, but I am wondering if it's a bug of the new release or if I can set the title visibility using navigation bar settings. 

I can't find in the documentation when 'km-hide-title' style is applied. 

Thank you,
Ina

Iliana Dyankova
Telerik team
 answered on 20 Jan 2015
5 answers
251 views
Hi,
     I am using telerik rich text editor, the problem which I am facing is, in IE 9 or IE 10, after typing a sentence and then applying bold style to the first word only then the whole paragraph's style is getting changed to bold. This is not happening in IE 7, IE 8, Chrome etc. So, any can please throw some light on it to help me.
Alex Gyoshev
Telerik team
 answered on 20 Jan 2015
1 answer
236 views
I have the following grid:

@(Html.Kendo().Grid<MyApp.WebUI.Models.MyModel>()
                    .Name("grid")
                    .Columns(columns =>
                    {
                        columns.Bound(m => m.codeType).ClientTemplate("#=codeType.code_type#").Width(75);
                        columns.Bound(m => m.codeVersion).ClientTemplate("#=codeVersion.code_version#").Width(75);
                    })
                    .Editable(editable => editable.Mode(GridEditMode.InCell))
                    .Events(events => events.DataBound("onDataBound"))

Both columns use a combo box for the EditorTemplate.
I am looking for a solution that disables the 2nd column on default.  Then based on value selected for 1st column, column 2 is either enabled or stays disabled.

Any guidance would be much appreciated.
Kiril Nikolov
Telerik team
 answered on 20 Jan 2015
2 answers
242 views
I have some cascading drop downs, that work well when first loaded, but when submitting the form and form is not valid the form is reloaded. The cascading dropdowns are populated as before but this time the cascaded dropdown does not send a value.
I can see with IE F12 tools that when I select from the list a span is loaded with the text value of my selection, but the input has no value. I can see when I do he same with the top dropdown that the input is populated with a value.
Thanks
Georgi Krustev
Telerik team
 answered on 20 Jan 2015
1 answer
439 views
Hi,

I am facing a problem when I don't want to show All elements" column in order to show, by default, all elements in a pivotgrid. 
Here is what I have currently;
pivotgrid.jpg

I also would like to remove the pivotgrid's footer which shows the total, located at the bottom of the grid. 
Here is what I would like to have ;
new.jpg
Georgi Krustev
Telerik team
 answered on 20 Jan 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?