Telerik Forums
UI for ASP.NET MVC Forum
7 answers
206 views

I'm trying to work the new preview version for .net core 1.0.  However, the issue I'm having is that the grids will not display any data when using the MVC version.  If I create the grid using the javascript version, it works.

Both grids call the same function and both return data.  However, only Grid2 displays any data. 

Using the KendoUI Chrome plugin, the Kendo Linter gives me two errors on Grid1.

http://localhost:20504/:92,944 Unknown option: prefix
http://localhost:20504/:92,1146 Unknown option: fields

Also, inspecting the grid, the _data for Grid1 shows Array[0], while the _data for Grid2 shows Array[1].

<h1>Grid 1</h1>
@(Html.Kendo().Grid<TelerikCoreTest1.Model.GridModel>()
    .Name("Grid1")
    .Columns(col =>
    {
        col.Bound(x => x.Id);
        col.Bound(x => x.Text);
 
    })
    .DataSource(ds => ds
        .Ajax()
        .Read(rd => rd.Action("Grid_Read", "Home"))
    )
    .Deferred()
)
 
<br />
 
<h1>Grid 2</h1>
 
<div id="Grid2"></div>
 
@section scripts {
 
    <script>
        var readUrl = '@Url.Action("Grid_Read", "Home")'
 
        $("#Grid2").kendoGrid({
            height: 400,
            columns: [{ title: "Id", field: "id" },
                {title: "Text", field: "text"}
            ],
            dataSource: {
                transport: {
                    read: readUrl
                },
                schema: {
                    data: "data"
                }
            }
        });
    </script>
 
    @Html.Kendo().DeferredScripts()
}

public IActionResult Grid_Read([DataSourceRequest]DataSourceRequest request)
{
    List<GridModel> data = new List<Model.GridModel>();
 
    GridModel gm = new GridModel()
    {
        Id = 1,
        Text = "Testing"
    };
 
    data.Add(gm);
 
    return Json(data.ToDataSourceResult(request));
}

Michel
Top achievements
Rank 1
 answered on 27 Oct 2016
1 answer
123 views
Is there any way to use logical operators like AND or OR in formula? Stacking IFs is rather inconvinient in larger formulas.
Veselin Tsvetanov
Telerik team
 answered on 27 Oct 2016
3 answers
409 views

I have a requirement to show by default editable textbox in each cell of a row. i saw teleriks examples but they say when you click on cell then they become editable.

1. my first requirement is to by default show textbox in each cell of the row.

2. in the same context , second requirement is to calculate the total of numeric textboxes value in a row and show the total in the last column which will be a normal cell (i mean not editable)

Please guide

 

Konstantin Dikov
Telerik team
 answered on 27 Oct 2016
2 answers
119 views

I'd like to create a product filtering mechanism like Bestbuy, Amazon, etc. use, where the user can check various filter nodes (on the left side of the screen) and click Apply to have the resulting products (in a grid) filtered.  Since I will need different levels of nested filtering, I thought that a TreeView would be the way to go.  I have my filters loaded into the TreeView, but now I want to implement a limit for how many filter criteria under a given node can be seen at one time...essentially listing the first 5, then having a "more..." or "see all..." button that the user can click in order to see all the filter nodes.  

Any suggestions as to how to go about implementing that?  Or, perhaps the TreeView is not the way to go for this kind of thing?

Thanks!

 

 

Peter Milchev
Telerik team
 answered on 26 Oct 2016
4 answers
1.3K+ views
Hello,

we try to add custom Buttons with Icons and no Text. Does anyone know how to solve this Problem?

By now, we use the following Code to show the Buttons:
<!--
columns.Command(commands =>
{
commands.Custom("CustomEdit").Text(“Edit”).Click("edit");
commands.Custom("CustomCopy").Text("Copy")).Click("copy");
commands.Destroy().Text("Delete");
}).HtmlAttributes(new { style = "text-align: center;" }).HeaderTemplate("<div style='text-align: center;'>" + "Options" + "</div>").Width(240);
-->
Dimiter Madjarov
Telerik team
 answered on 26 Oct 2016
7 answers
996 views
Hi,

I've got the next problem:  'Sorts' parameter of DataSourceRequest is null.
I've found a few threads here with similar issues but the only difference is that i'm not using MVC wrapper for Kendo Grid. Also I can confirm that MVC wrapper works perfectly in my case, but I need to manage grid without it.

Here is the simple sample of what i've got now. What I'm doing wrong?

My scripts bundle:
- jquery.min.js 
- kendo.all.min.js 
- kendo.aspnetmvc.min.js

Kendo Grid declaration:
 $('#cars').kendoGrid({
            pageable: true,
            sortable: true,
            dataSource: new kendo.data.DataSource({
                serverPaging: true,
                serverSorting: true,
                schema: { data: "Data",  total: "Total" },
                transport: {
                    read: {
                        url: '@Url.Action("GetCars")',
                        contentType: "application/json; charset=utf-8",
                        type: "POST"
                    },
                    parameterMap: function (data) {
                        return JSON.stringify({ request: data }); 
                    }
                }
            })
        });

Action:
public DataSourceResult GetCars([DataSourceRequest]DataSourceRequest request)
{
    ............................
}

HTTP request parameters:
{"request":{"sort":[{"field":"Name","dir":"desc"}]}}

Thanks!
Kostadin
Telerik team
 answered on 26 Oct 2016
3 answers
854 views

Hi,

I have a requirement where i want to show filters in headers.

scenario : i have kendo grid with 10 columns.

first column header should appear as a dropdown in header. user can use this dropdown for filter.

second column header should appear as text box in header. user will use textbox for filter.

remaining 8 header columns should be with no filters.

please see attachment. that is exactly my header columns should look like. i.e. first two with dropdown and textbox filter and rest normal.

i have seen this example http://demos.telerik.com/kendo-ui/grid/filter-row . however in this example filter rows appear as a seperate row and not in header.

 

please guide

 

 

 

 

 

Vessy
Telerik team
 answered on 25 Oct 2016
4 answers
266 views

In the demo (http://demos.telerik.com/kendo-ui/editor/immutable-elements) or the preview in the api reference (http://docs.telerik.com/kendo-ui/api/javascript/ui/editor#configuration-immutables) the immutable elements (html elements that have the contenteditable="false" attribute) can be deleted.

They can be selected by double clicking and deleted by pressing Delete. Or just selecting everything in the editor and pressing Delete. Tested with Chrome 53 and Internet Explorer 11.

I am confused as the description for Immutable Elements states:

"The Kendo UI Editor widget and its Immutable Elements feature enables you to predefine elements in the content area that cannot be edited by the end user."

I assumed that edited also meant deleted. Is this the intended behaviour?

Ianko
Telerik team
 answered on 25 Oct 2016
1 answer
260 views

i am building an asp.net MVC application. Requirement is to have kendo grid's header column titles coming from server and not hard coded. 

how to achieve this using asp.net MVC. please guide.

 

 

Konstantin Dikov
Telerik team
 answered on 25 Oct 2016
1 answer
149 views

Hello,

I'm using version 2016.3.914.545, which I believe is the latest version, and the "ClearButton" method is not available as described by the Telerik docs: http://docs.telerik.com/kendo-ui/api/aspnet-mvc/Kendo.Mvc.UI.Fluent/AutoCompleteBuilder#methods-ClearButton(System.Boolean)

Please advise.

In addition, is there a default way to have this control set focus to itself when the 'ClearButton' is pressed or do I have to do something custom in the 'Change' event?

Thanks,
Mike

 

Rumen
Telerik team
 answered on 24 Oct 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?