Telerik Forums
UI for ASP.NET MVC Forum
5 answers
343 views
Hello,
If we use inline of batch edit mode for the grid,can i use  validations  if i add DataAdnotations on my Model/ViewModel or what kind of validations is possible?

Regards,
Daniel
Daniel
Telerik team
 answered on 07 Mar 2013
1 answer
74 views
Hi,

I am using a trial of KendoUI and the mvc3 template works very well.  However if I follow the instructions on the page linked below for mvc4, I am encountering rendering issues with the grid.  Specifically, the filter buttons in the column headers move and flicker when moved over, and it no longer groups-by.  There are also gaps on the column dividers where they meet the top edge of the grid.

http://docs.kendoui.com/documentation/getting-started/using-kendo-with/aspnet-mvc/introduction

Is there anything else I am missing to use the controls with mvc4?
Vladimir Iliev
Telerik team
 answered on 06 Mar 2013
5 answers
216 views
Hi, new to Kendo . . .

From the View:

function InitGrid() {

    $("#grid").kendoGrid({
        dataSource: oRemoteDataSource,
        edit: EditMe,
        save: SaveMe,
        error: function (e) {
            alert(e.responseText);
        },
        pageable: {
            numeric: true,
            refresh: true,
            pageSizes: [3, 6, 10],
            previousNext: true,
            input: false,
            info: false
        },
        sortable: true,
        selectable: "row",
        id: "Code",
        schema: {
            model: {
                id: "Code",
                fields: {
                    "Name": { editable: false },
                    "Code": { nullable: true },
                    "IsPrecontract": { editable: false },
                    "IsActive": { editable: false }
                }
            }
        },
        columns: [
                { field: "Name", title: "Name", width: "450px" },
                { field: "Code", title: "Code", width: "40px", editable: false },
                { field: "IsPrecontract", title: "IsPrecontract", width: "80px" },
                { field: "IsActive", title: "IsActive", width: "80px" },
                { command: ["destroy"], title: " ", width: "80px" }
        ],
        toolbar: [
         "create",
         { name: "save", text: "Save This Record" }
        ],
        editable: {
            update: true,
            destroy: false,
            confirmation: "Are you sure you want to remove this category?"
        },
    });
}

Now the data source:

function InitDataSource() {

    oRemoteDataSource = new kendo.data.DataSource({
        type: "odata",
        pageSize: 10,
        transport: {
            read: function (options) {
                $.ajax({
                    url: "/KendoGrid/MasterCategories_Read",
                    data: options.data, // the "data" field contains paging, sorting, filtering and grouping data
                    success: function (result) {
                        //         alert(JSON.stringify(result));
                        $("#json").html(JSON.stringify(result));
                        options.success(result);
                    }
                });
            },
            update: {
                url: "/KendoGrid/MasterCategories_Update",
                type: "POST"
            }
        }
    });
}

Now my JSON from the Controller, shows up ok . . . but not in the grid, only on my page in a div right underneath the empty grid that has only the column names showing: (I formatted the top few here for easy reading)

{"Data":[
{"Name":"Hardwood Stairs","Code":"39","IsPrecontract":"N","IsActive":"Y"},
{"Name":"Siding","Code":"10","IsPrecontract":"N","IsActive":"Y"},
{"Name":"Fireplace","Code":"26","IsPrecontract":"N","IsActive":"Y"},
{"Name":"Stair Railing","Code":"40","IsPrecontract":"N","IsActive":"Y"},
{"Name":"Tile Accessories","Code":"25","IsPrecontract":"N","IsActive":"Y"},
{"Name":"Interior Doors","Code":"36","IsPrecontract":"N","IsActive":"Y"},
{"Name":"Hardware & Mirrors","Code":"31","IsPrecontract":"N","IsActive":"Y"},
{"Name":"Permit, Fees and Insurance","Code":"01","IsPrecontract":"Y","IsActive":"Y"},{"Name":"Job Clean-up","Code":"34","IsPrecontract":"Y","IsActive":"Y"},{"Name":"Deck","Code":"12","IsPrecontract":"N","IsActive":"Y"},{"Name":"Countertops","Code":"29","IsPrecontract":"N","IsActive":"Y"},{"Name":"Rain Gutters","Code":"32","IsPrecontract":"N","IsActive":"Y"},{"Name":"Light Fixtures","Code":"20","IsPrecontract":"N","IsActive":"Y"},{"Name":"Entry Doors","Code":"13","IsPrecontract":"N","IsActive":"Y"},{"Name":"Damp Proofing","Code":"07","IsPrecontract":"Y","IsActive":"Y"},{"Name":"Electrical","Code":"19","IsPrecontract":"N","IsActive":"Y"},{"Name":"Temporary Utilities","Code":"04","IsPrecontract":"Y","IsActive":"Y"},{"Name":"Architecture & Engineering","Code":"03","IsPrecontract":"Y","IsActive":"Y"},{"Name":"Paint","Code":"24","IsPrecontract":"N","IsActive":"Y"},{"Name":"Speciality Items","Code":"80","IsPrecontract":"N","IsActive":"Y"},{"Name":"Windows","Code":"15","IsPrecontract":"N","IsActive":"Y"},{"Name":"Drywall","Code":"22","IsPrecontract":"Y","IsActive":"Y"},{"Name":"Electrical Features - Upgrade","Code":"42","IsPrecontract":"N","IsActive":"Y"},{"Name":"Garage Doors","Code":"14","IsPrecontract":"N","IsActive":"Y"},{"Name":"Foundation","Code":"06","IsPrecontract":"Y","IsActive":"Y"},{"Name":"Insulation","Code":"21","IsPrecontract":"Y","IsActive":"Y"},{"Name":"Cabinets","Code":"28","IsPrecontract":"N","IsActive":"Y"},{"Name":"Stone","Code":"23","IsPrecontract":"N","IsActive":"Y"},{"Name":"Trim Materials","Code":"37","IsPrecontract":"N","IsActive":"Y"},{"Name":"Design Ideas","Code":"00","IsPrecontract":"Y","IsActive":"Y"},{"Name":"Appliances","Code":"30","IsPrecontract":"N","IsActive":"Y"},{"Name":"Central Vacuum","Code":"33","IsPrecontract":"N","IsActive":"Y"},{"Name":"Roofing","Code":"11","IsPrecontract":"N","IsActive":"Y"},{"Name":"Framing","Code":"08","IsPrecontract":"Y","IsActive":"Y"},{"Name":"Lot Improvements","Code":"02","IsPrecontract":"Y","IsActive":"Y"},{"Name":"Air Conditioning","Code":"18","IsPrecontract":"Y","IsActive":"Y"},{"Name":"Heating and Ventilation","Code":"17","IsPrecontract":"Y","IsActive":"Y"},{"Name":"Plumbing","Code":"16","IsPrecontract":"N","IsActive":"Y"},{"Name":"Closet Shelving","Code":"38","IsPrecontract":"N","IsActive":"Y"},{"Name":"Flooring","Code":"27","IsPrecontract":"N","IsActive":"Y"}],"Total":40,"AggregateResults":null,"Errors":null}

And this won't show up in the grid why exactly?

Thanks
Atanas Korchev
Telerik team
 answered on 06 Mar 2013
1 answer
119 views
Hello,

I'm evaluating the KendoUI grid for a project that I am doing. I like the inline editors that your grid provides but the issue I have with that is the editor can be assigned only at the column level. What if I want to be able to specify the editor type on a per cell level. How would I do that? 

In my application I also need to show TreeView type of hierarchy in the grid that allows the user to expand and collapse rows in the grid. The grid would be something like the following shown in the SlickGrid example

http://mleibman.github.com/SlickGrid/examples/example5-collapsing.html

Would you be able to do that with KendoUI? Is there some sample code you can show me?

Also, I see that KendoUI uses ODATA instead of JSON. Is there a reason for that? Can I use the KnockoutJS data binding feature instead of KendoUI data binding techniques for the grid?

Thanks.
Vladimir Iliev
Telerik team
 answered on 05 Mar 2013
3 answers
1.0K+ views
I'm using the grid to fetch data from an ASPNET MVC intranet application which has Authorize attributes on the create/edit/delete actions.  The application uses WIndow authentication.

Rather than let the browser prompt the user for new credentials, I want to display a dialog or similar to inform the user politely they do not have the correct authorisation to perform that action.

Is there a way to configure the grid to handle 401 (or 403 if it is more suitable) in such a way?

Also, as a side note, my grid is in batch edit mode by default. Is there a way to put the grid into readonly if the user does not have permission for editing? Or do I need to define the grid twice and show a different partial view based on roles?

Thanks,
Nick

Daniel
Telerik team
 answered on 05 Mar 2013
1 answer
120 views
Hi
I see this your example for custom editing, now, I want to use this feature  with Treeview.
I means that when a cell is in editing mode, show Treeview instead dropdown, and when user click on one of item, see this on that cell.
Is there possible? 
can I see a example ?

Thanks for replay.
Petur Subev
Telerik team
 answered on 05 Mar 2013
4 answers
154 views
This is what I am returning as ActionResult from the Controller:

// oCats is List of Category objects so derives from IEnumerable

           var vResult = oCats.ToDataSourceResult(request);
           var x = Json(vResult, JsonRequestBehavior.AllowGet);
           return (x);

When I mouse over the breakpoint on the last line, I have all forty Categories properly . . . but when the View tries to load I get this:

"Unhandled exception at line 190, column 1 in Function code
0x800a138f - Microsoft JScript runtime error: Unable to get value of the property '__count': object is null or undefined"

in the Function js file and it crashes.  Ideas for solution?

Thanks
Nikolay Rusev
Telerik team
 answered on 05 Mar 2013
2 answers
194 views
I have a slider in our site, I am sure it had marker lines when I first put it in, but now it doesn't, I thought there must be some css overriding it, but removing all the css and still no marker lines,
what could be causing this? is there some css I should look at?
Any ideas I have spent a lot of time on this.
Thanks
Alan Mosley
Top achievements
Rank 1
 answered on 05 Mar 2013
1 answer
71 views
Hi,
Just wonder if there may be any issues when we use a non-html5 MVC control (i.e. namely Spread.net) with the Kendo UI?

Regards,
Andy
Sebastian
Telerik team
 answered on 05 Mar 2013
3 answers
164 views
Hi,

Both Template and CheckboxTemplate do not seem to affect my nodes that have been created through BindTo.  Special characters in the templates are also resulting in their escaped source code representations such as "\u0027".  Can you guys please provide some advice and perhaps an example of a databound TreeView created through the Fluent API that uses checkboxes?  Thanks. 
Alex Gyoshev
Telerik team
 answered on 05 Mar 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?