Telerik Forums
UI for ASP.NET MVC Forum
9 answers
516 views
This is a very weird behaviour but for some reason we can initialize Grids using Kendo's MVC HTML style helpers but DropDownList, DropDownListFor and other widgets just don't work.

Here's the code: 
@(Html.Kendo().DropDownListFor(model => model.Gender) .OptionLabel("Select Gender").BindTo(Model.GenderList).Deferred(true))
@Html.ValidationMessageFor(m => m.Gender)

There are no JS errors but the resulting HTML looks like this: 
<input type="text" value="-1" name="Gender" id="Gender" data-val-required="The Gender field is required." data-val-range-min="0" data-val-range-max="1" data-val-range="Gender is required" data-val="true" class="input-validation-error">
 
<span data-valmsg-replace="true" data-valmsg-for="Gender" class="field-validation-error"><span for="Gender" class="">Gender is required</span></span>

If I instantiate this via javascript using a normal MVC drop down list:
<h3>Test Drop Down list</h3>
@Html.DropDownListFor(m => m.Gender, Model.GenderList, new { @class = "dropdown-list form-control"})
<script>
//instantiate drop down lists
$(".dropdown-list").kendoDropDownList();
</script>

It works! 

So I assume the Kendo libs are loading fine, but for some reason the MVC side of things are only partially working. 

Grids work: 
@(Html.Kendo().Grid<DependantModel>(Model.Dependants)
        .Name("Dependants")
        .Columns(columns =>
        {
              ... left out for brevity
        }) .DataSource(dataSource => dataSource
                        .Server()
                        .Model(model => model.Id(p => p.Id))
                        .Destroy(update => update.Action("EditingInline_Destroy", "Grid"))
                    )
                    .Deferred(true)
                    )

Charts work but the code is too long to paste here. 

Any ideas why other widgets won't work? 





Jacques
Top achievements
Rank 2
 answered on 28 Oct 2014
1 answer
112 views
Hello:
Is there a PersistenceManager for asp.net MVC applications specifically for the Grid?
Thanks
Robert
Petur Subev
Telerik team
 answered on 28 Oct 2014
1 answer
134 views
I have seen some examples of using server side Kendo extensions to access Web API calls in the same project.  But what about if the Web API is a different project and URL?  We are doing this as an N-Tier where the Web API is the data access for multiple client applications.  Do you have a same using the server side KendoGrid to access a Web API call that is located on a different server/URL?  I can't figure this out.

Here is what I have tried.  Both projects have a reference to the data classes so I hope to send a known type back and forth.  But this doesn't work:

@(Html.Kendo().Grid<CustomerOrderModel>()
    .Name("Grid")    
        .Columns(columns =>
                     {
                         columns.Bound(o => o.OrderNumber);

                         columns.Bound(p => p.Description);

                         columns.Bound(p => p.Description2);

                         columns.Bound(p => p.Notes);

                     })
    .DataSource(dataSource => dataSource
        .WebApi()        
        .Read(read => read.Url("http://localhost:52559/api/CustomerOrder").Type(HttpVerbs.Get))

    )
)
Petur Subev
Telerik team
 answered on 28 Oct 2014
1 answer
421 views
I'm currently looking at Filters on the ASP MVC grid. 

I have this line on my grid:

.Filterable(filterable => filterable.UI("$.fn.kendogrid().userDropdownFilter"))

which works fine, and I can access the original filter element in the userDropdownFilter(element) function in my JavaScript.

I was wondering if it was possible to send additional parameters to this function though, and still pass the original element variable?

Thanks
Alexander Popov
Telerik team
 answered on 28 Oct 2014
1 answer
191 views
Hi:
I'm trying to run the Grid Popup editing example and get an error on return Json(productService.Read().ToDataSourceResult(request));
It cant can't find productService.
I'm assuming I'm missing the productService class?
thanks
Robert
Alexander Popov
Telerik team
 answered on 27 Oct 2014
1 answer
99 views
Hi,

I'm working on a use case where the user is requires to enter a text before he is allowed to edit the content of a row. I want to use a jQuery UI Dialog to prompt a small form that the use need to fill before the row go to edit mode. Using jQuery I was able to bind a handler to the "click" event of the edit button, so I can open the dialog. However I can't find a way to prevent the grid from switch into edit mode before I get the response from the dialog.The result is that if the user close the dialog he can edit the row without fill out the form. Any ideas on how to prevent the default row edit?
Rosen
Telerik team
 answered on 27 Oct 2014
10 answers
638 views
I'm utilizing the new frozen (locked) column functionality in the latest release (2014.1.318.340) and noticed that the rows of the locked columns do not line up with those of the unlocked columns (see attached screenshot).  If I click around it eventually realigns itself, but this isn't acceptable for our client.  I believe in one of the non-MVC forums you provided a fix for this issue.  Thanks! 
Nikolay Rusev
Telerik team
 answered on 27 Oct 2014
3 answers
358 views
Hi:
I'm populating a grid field from an on blur from a field in a tab strip.
How do I make the little red icon show in the grid signifying a dirty field so that my batch save will pick it up?

Thanks
Robert
​
Nikolay Rusev
Telerik team
 answered on 27 Oct 2014
2 answers
136 views
Hi,

We have an requirement that allow a user to enter multiple records at a same time. As I have seen the demo, I feel the batch editing is good option for us.

But we might have a issue that, we need to allow user to select a data from different controls such as Dropdown list, Datepicker and may be some other. In one of the demo sample, I have seen that Dropdown list is added to a column by specifying Foreign Key column mapping (If I am not wrong, that has been done by using Entity Framework).
 
We are using Model class as source to bind the Grid and we are not using Entity Framework here. By binding Model class is it possible that, we can add these different controls to the columns and is there any examples or sample code?

Regards!
Venkat
Top achievements
Rank 1
 answered on 25 Oct 2014
4 answers
1.6K+ views
Hello, I have this grid:

@(Html.Kendo().Grid(Model.ListiniRighe)
    .Name("ListiniRighe")
    .Columns(columns =>
    {
        columns.ForeignKey(l => l.LForId, listFor, "LForId", "Formula");
        columns.Bound(l => l.DocAmount).Format("{0:c}");
    })
    .ToolBar(toolbar => toolbar.Create())
    .Editable(ed => ed.Mode(GridEditMode.InCell))
)

I want to disable the "DocAmount" cell if the "LForId" have a specific value, and everytime I change the value I want to check and enable\disable the cell.
How can I do that...
Tiago
Top achievements
Rank 2
 answered on 24 Oct 2014
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?