Telerik Forums
UI for ASP.NET MVC Forum
1 answer
68 views
Hi there,

I have a grid which contains "Quantity" and "Amount" columns. When the user selects multiple rows from the grid, they can then click a "Sum" button which will calculate the Total Quantity and Total Amount based on the current selected rows. How can I achieve this?
Dimiter Madjarov
Telerik team
 answered on 13 Aug 2013
1 answer
1.9K+ views
Test case:
1. I type "March 2015" into DatePicker
2. Kendo validator accepts this value, i.e. "kendo.parseDate(input.val()) !== null". So the form can be submitted.

The first problem: pop-up calendar does not show the date 03/01/2015. Why? 

3. On the server side I have model property  correctly binded from the incoming value "March 2015" (so it has value "03/01/2015"). And I return the same view with the same model. That value is again rendered as <input value="March 2015"...>

The second problem:
 I have empty value in datepicker in browser. 
Is there a way to get value in datepicker in this situation? I'm awared about parseFormats parameter. But why the default behavior is so strange? Why you do not use kendo.parseDate(input.value) when no parse formats are given explicitly?

The same problem is here when I type date in some other formats - '2013/02/13' for example. Kendo Validator accepts this value, MVC default model binder accepts this value, but widget does not. It seems to me you use ""format" property of DatePicker options to parse a value when parseFormats are not given explicitly.
Vladimir Iliev
Telerik team
 answered on 13 Aug 2013
3 answers
480 views
Is it possible to disable spell checking?

Setting 
Html.Kendo().MultiSelect().HtmlAttributes(new { spellcheck = "false" }) ...
doesn't disable spell checking. 

Thanks!
Vladimir Iliev
Telerik team
 answered on 13 Aug 2013
5 answers
197 views
I am trying to place a grid inside a mobile view, but the grid is slightly too large and some of the words in the last column get cut off.  What is the best way to accommodate the additional scrolling.  Maybe zoomable views ??
Nikolay Rusev
Telerik team
 answered on 13 Aug 2013
1 answer
117 views
As I state in the subject.  Is it possible to have batch editing/deletion, but the have a Popup Create?

I actually want to take it a step further and use the values from the grid's 'selected' rows to pre-populate/default the 'Create' pop-up.

Are either possible?

Thanks,
David
Alexander Valchev
Telerik team
 answered on 12 Aug 2013
1 answer
311 views
Hi everyone,
I am using Kendo Grid Hierarchy in my ASP.Net MVC application.

For each row in my parent table, i have an option to add a child table.

My parent table is associated with a model. Each row in this parent table has several columns:
- ID
- Name
- Amount
- Button
Every time i add a parent row, all values are empty (ID and Name).

Now, here is my problem:

When my parent row has a child table filled with rows, e need to hide the button in the parent row. 
When i remove my child table, i need to show the buttons again.
I also need to fill a hidden column in the child table, which indicates me who is the parent row.

How can i do this, only in the client side (using javascript)? I want to edit my information inline, and i would like to make a post only after my editing is completed, serializing my table to JSON and sending it to the server.

Thanks in advance.

Best regards
Atanas Korchev
Telerik team
 answered on 12 Aug 2013
2 answers
232 views
My data structure consists of groups and users with a link table between them.  I have setup an OData data source, where I can do either of the following:

/api/Users?$expand=USERGROUPS
or 
/api/UserGroups?$expand=USERS

I want to display a grid with user groups, and the details row to be a grid of users.

Setting up the grid, I use /api/UserGroups in the data source, and I get all my groups to appear.  Where I am experiencing a problem is displaying the users for a selected group.

At first glance, the data source method to use seems to be /api/Users?$expand=USERGROUPS.  I wrote a function that takes in the value of the selected group from detailInit(e), where e is the USERGROUP.data value, and the group's properties can be accessed:

function userDataSource(groupData) {
    console.log("group data");
    console.log(groupData);
    var userDS = new kendo.data.DataSource({
        type: "odata",
        transport: {
            read: {
                //url: "/api/UserGroups?$expand=USERS",
                url: "/api/Users?$expand=USERGROUPS",           // only need to expand users for the selected group
                dataType: "json"                                // the default result type is JSONP, but WebAPI does not support JSONP
            },
            parameterMap: function (options, type) {
                // this is optional - if we need to remove any parameters (due to partial OData support in WebAPI
                var parameterMap = kendo.data.transports.odata.parameterMap(options);
                return parameterMap;
            }
        },
        schema: {
            data: function (data) {
                console.log("USERS");
                console.log(data.value);
                return data.value;
            }
            ,
            total: function (data) {
                console.log("user count: " + data["odata.count"]);
                return data["odata.count"];
            },
            model: {
                fields: {
                    ITEMID: { type: "string" },
                    USERNAME: { type: "string" },
                    FIRSTNAME: { type: "string" },
                    LASTNAME: { type: "string" },
                    EMAIL: { type: "string" }
                }
            }
        },
        pageSize: 10,
        //filter: { field: "odata.value.USERGROUPS.ID", operator: "eq", value: groupData.ID },                     // filter where the the user.group nav prop ID = group id
        serverPaging: true,
        serverFiltering: true,
        serverSorting: true
    });
 
    return userDS;
 
}

function detailInit(e) {
 
    $("<div/>").appendTo(e.detailCell).kendoGrid({
        dataSource: userDataSource(e.data),
        scrollable: false,
        sortable: true,
        pageable: true,
        columns: [
            { field: "USERNAME", title: "User Name", width: "130px" },
            { field: "EMAIL", title: "Email", width: "130px" },
            { field: "NETWORKID", title: "Network ID" }
        ]
    });
 
 
    //var detailRow = e.detailRow;
 
    //detailRow.find(".tabstrip").kendoTabStrip({
    //    animation: {
    //        open: { effects: "fadeIn" } 
    //    }
    //});
}

userDataSource(groupData) returns an array of USERS[], and due to the pageSize attribute, limited to 10.  USERS.  Each USERS element contains a USERGROUPS[] (array) element.

What I would like to return is a list of users where USERS.USERGROUPS.ID == groupData.ID, and have these all displayed in the details grid.

I considered using api/UserGroups?$expand=USERS as the datasource.  In that case I would have to return the array of users within a given group.

Regardless, the filter option I am trying on the data set is not working:
filter: { field: "odata.value.USERGROUPS.ID", operator: "eq", value: groupData.ID },                     // filter where the the user.group nav prop ID = group id

I realize that I could write another data source API that only spits out a list of users (which maybe much simpler), but I would like to know how to use this expanded, navigation content data.

Assistance on this would be appreciated.



B
Top achievements
Rank 1
 answered on 09 Aug 2013
1 answer
120 views
I have tried to add an item to treeview when user click expand icon.  But it doesn't work.

Please help.

function onExpand(e) {
  var expandedNode = e.node;
 if (expandedNode.length == 0) {
      expandedNode = null;
}
treeview.append({
text: 'newNode'
}, expandedNode);

}
Yingyi
Top achievements
Rank 1
 answered on 09 Aug 2013
2 answers
228 views
I need to determine whether an item has children or not.
Any easy way to do it?

Thanks.

Yingyi
Yingyi
Top achievements
Rank 1
 answered on 09 Aug 2013
5 answers
197 views
Hi there,

I am currently mocking up a demo of a chart. I have attached an image.

I need to replace the numbers on the right axis with labels.

For example,
0 will be Nil
5 will be Bronze
10 will be Silver
15 will be Gold
20 will be Platinum
25 will be Diamond

How can I show labels for that right axis instead of the numbers?

Regards,
Tony
Iliana Dyankova
Telerik team
 answered on 09 Aug 2013
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?