Telerik Forums
UI for ASP.NET MVC Forum
2 answers
422 views
Hi,

We have a requirement in our application that the user should not check the Root node, we need to disable the checkbox of root node alone.
We are loading the treeview using Ajax Binding (Load on Demand).
Please help.!

Thanks,
Vidya

Vidya
Top achievements
Rank 1
 answered on 20 Feb 2013
1 answer
114 views
Hi,

I display time in my grid by using:
columns.Bound(p => p.StartDate).Format("{0:HH:mm}").Title("Tid");
When i change my timezone the time changes, how do i prevent this?

i use:

<script src="@Url.Content("~/Scripts/kendo/2012.3.1121/cultures/kendo.culture.sv-SE.min.js")"></script>
 
<script>
      $(document).ready(function () {
        //set culture of the Kendo UI
        kendo.culture("sv-SE");
    });
</script>
But it still changes when i change my timezone.
Daniel
Telerik team
 answered on 20 Feb 2013
1 answer
1.4K+ views
Hello Telerik Team,

I'd like to know if there's any way to pass in an extra parameter to my controller action when using async upload.  Below is what the controller looks like.

public ActionResult Save(IEnumerable<HttpPostedFileBase> files, string uploadID)
{
 
}

One workaround I came up with is to use the route value below.  The I can update the saveUrl property of the upload control to inject the correct uploadID before the upload begins.  

@(Html.Kendo().Upload()
    .Name("files")
    .Async(a => a
        .Save("Save", "Upload", new { uploadID = "XXX" })
        .Remove("Remove", "Upload")
        .AutoUpload(true)
    )
)

If there's a proper solution to this, please advice.  Thank you!
Rene
Top achievements
Rank 1
 answered on 20 Feb 2013
0 answers
90 views
WOW!

I have written an async file upload in the past and I could not believe how easy you guys have made it to do async uploads. Unreal!

Try prying Kendo out my hands lol.

This framework is **awesome**.

Thank You!
Rene
Top achievements
Rank 1
 asked on 19 Feb 2013
4 answers
669 views
Hello,
what type is oData,how is formated the data?and what other types can be for grid datasource?
can i see somewhere a description of all grid parameters what they does?

i used oData type,and get from the server with GetProductList mvc action in json format the data,and nothing is happening,the grid is not filled.
the grid definition is like that
$(document).ready(function () {
                    var grid = $("#grid").kendoGrid({
                        dataSource: {
                            type: "odata",
                            transport: {
                                read: "/Controls/GetProductList"
                            },
                            pageSize: 15,
                            serverPaging: true,
                            serverSorting: true,
                            serverFiltering: true
                        },
                        toolbar: kendo.template($("#template").html()),
                        height: 450,
                        sortable: true,
                        pageable: true,
                        columns: [
                            { field: "ProductID", width: 100 },
                            { field: "ProductName", title: "Product Name" },
                            { field: "UnitPrice", title: "Unit Price", width: 100 },
                            { field: "QuantityPerUnit", title: "Quantity Per Unit" }
                        ]
                    });

Best Regards,
Daniel
Daniel
Top achievements
Rank 1
 answered on 19 Feb 2013
0 answers
126 views
please delete this post
I fixed a bug
Gusev
Top achievements
Rank 1
 asked on 19 Feb 2013
2 answers
519 views
Hello,
I have the following problem. When I bind an empty list of items to the grid (Server Binding) the grid shows me an empty row. The empty row has a class name "t-no-data" assigned. I could not find the css class "t-no-data" in any of the Kendo CSS files. Because of the prefix "t-" and not "k-" I assume this is a leftover from the Telerik MVC controls.

I just tried to override the "t-no-data" class in my custom css file and set the tr height to 0px to hide the empty row, but that does not work...
.t-no-data
{
    height: 0px;
}

Here is how I defined the Grid in the Razor View:
@* Server Grid-Binding *@
@{
    @(Html.Kendo().Grid(Model)
        .Name("GridWFClasses")
        .Columns(columns =>
        {
            columns.Bound(c => c.ID).Width(50).Title(WFClasses.ColumnID).Hidden(true);
            columns.Bound(c => c.Reference).Template(
                @<text>
                     <a href="javascript:redirectToControllerAction('@item.ControllerUrl')">@item.Reference</a>
                 </text>).Width(150).Title(WFClasses.ColumnReference);
            columns.Bound(c => c.WFTemplateFile.FileName).Width(150).Title(WFClasses.ColumnTemplate);
            columns.Bound(c => c.Description).Width("*").Title(WFClasses.ColumnDescription);
            columns.Bound(c => c.Url).Width(250).Title(WFClasses.ColumnUrl);
            columns.Bound(c => c.EditRights).Width(70).Title(WFClasses.ColumnEditRights);
        })
        .Resizable(m => m.Columns(true))
    )
}
And here is a screenshot so you see what I am talking about:

https://dl.dropbox.com/u/34560718/Kendo_Grid_EmptyLine.png

Can anyone tell me how I can hide the empy line? Thanks.
BigzampanoXXl
Top achievements
Rank 1
 answered on 18 Feb 2013
1 answer
97 views
Have simple model with RegularExpression attribute. This attribute correct work with unobtrusive validation.

public class PersonModel
{
    public int PersonId { get; set; }
    [RegularExpression(@"\+?\d[\d-]+\d")]
    public string Phone { get; set; }
}

Render data in Grid. 

@(Html.Kendo().Grid<PersonModel>().Name("Persons")
    .DataSource(src => src.Ajax()
        .Model(model => model.Id(p => p.PersonId))
        .Read("_GetPersons", "Account")
        .Create("_CreatePerson", "Account")
        .Update("_UpdatePerson", "Account")
        .Destroy("_DestroyPerson", "Account")
        .ServerOperation(true)
    )
    .ToolBar(command => command.Create())
    .Columns(col =>
    {
        col.Bound(p => p.PersonId).Hidden();
        col.Bound(p => p.Phone);
        col.Command(command =>
        {
            command.Edit();
            command.Destroy();
        });
    })
    .Pageable()
    .Editable(e => e.Mode(GridEditMode.PopUp))
)

On edit record in popup editor, have javascript error "SyntaxError: invalid quantifier" because in html field render parameter data-val-regex-pattern="+?d[ds-]+d". All backslashes is disappear. 
ОК, write expression as @"\\+?\\d[\\d-]+\\d". Validation on page is OK, but in action method ModelState.IsValid = false. How can I solve this problem? Code of action method see below.

[HttpPost]
public ActionResult _UpdatePerson([DataSourceRequest] DataSourceRequest request, PersonModel model)
{
    if (model != null && ModelState.IsValid)
    {
        DB.UpdatePerson(model);
    }
    return new JsonNetResult { Data = ModelState.ToDataSourceResult() };
}

Nikolay Rusev
Telerik team
 answered on 18 Feb 2013
5 answers
798 views
I am trying to achieve serverside paging and sorting with Kendo grid. 

I have done the following which is working fine, but this is completely in the JavaScript,

("#appointmentsGrid").kendoGrid({
        columns: [
                    { field: "MemberFirstName", title: "Member<br/>First Name" },
                    { field: "MemberLastName", title: "Member<br/>Last Name" }                   
                 ],
        dataSource: new kendo.data.DataSource({
        serverPaging: true,
        serverSorting: true,
        transport: {
            read: {
                url: "/AppointmentScheduling/GetScheduledAppointments",
                data: additionalData
            }

        },
        pageSize: 10,
        schema: { data: "data", total: "total" }
        }),
        pageable: true,
        sortable : true
    });   

 Can anyone has any idea how to achieve the same functionality through razor View, if so can you please give the controller sample code too.

Since it is in javaScript, there is no intellisense and hard to find out all the options that i can give it for a column. 
Rosen
Telerik team
 answered on 18 Feb 2013
1 answer
175 views
I have an edit view for a particular model.  The view contains the following Kendo autocomplete control code:

 @(Html.Kendo().AutoCompleteFor(model => model.Location).Placeholder("Please select a value")
               .Name("locationAutoComplete").BindTo((IEnumerable<LocationData>)ViewData["locationList"])
               .DataTextField("Name")) //Specifies which property of the Product to be used by the autocomplete.
               ;

The drop down auto complete is working.  However, existing values on the model (Location property) are not bound to the control.  When I open up an existing record in edit mode the autocomplete control is empty, even if the underlying Location property on the model has a value.  How does this control handle binding?
Daniel
Telerik team
 answered on 18 Feb 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?