Telerik Forums
UI for ASP.NET MVC Forum
5 answers
394 views
Hi, 

during evaluation of the KEndo library, I am now facing the next problem which I spent a lot time with now...

I try to create a listview. My viewmodel contains references to other classes, let's say I have a model class Person, which contains a property Address of type Address, which again has properties "Street" and "City".

So, I defined my template like this (also my editor template):
<script type="text/x-kendo-tmpl" id="template">
     <div>
       <dl>
         <dt>Street</dt> <dd>${Address.Street}</dd>
         <dt>City</dt> <dd>${Address.City}</dd>
       </dl>
     </div>
 </script>
But this leads to JavaScript exceptions, saying that the property is undefined. How can I handle this? Any idea is welcome, but this really a serious problem with complex data models. I cannot reduce my viewmodel to only have primitive properties, that woud cause too much effort...

Thanks!
Petur Subev
Telerik team
 answered on 18 Mar 2013
1 answer
646 views
I have an ASP MVC 4, .Net 4.5 project.  I am using the new EmailAddressAttribute validation data annotation attribute on my view models to validate a correct email format is posted.

The attribute is correctly rendered on the input element as <input type="text" ... data-val-email="Email address format is incorrect" .../>.

If I use the kendo validator to validate my form before post to server, the email rule seems to be ignored.  I believe I have included all the necessary js files to support unobstrusive validation.  All my other data annotation rules are applied correctly.

When I look at kendo.aspnetmvc.min.js, it appears as though the kendo "email" rule is never mapped to the data-val-email rule pattern?

If I write my input element from scratch <input type="email" required .../> obviously my email rule is applied correctly by the kendo validator.  This is not an ideal solution though because I am trying to standardise on using the data annotation attributes for my view models.

Can you please tell me if I have done something wrong?  I rechecked the 2012 q3 beta and it appears to have the same limitation.

Thanks





Shiva
Top achievements
Rank 1
 answered on 16 Mar 2013
1 answer
190 views
Maybe I'm going about this the wrong way but the model populating the AutoComplete has an Id and a Name.  I display the Name but when the form is submitted I need to return the Id since it will bind to the property on the model.

Presently the AutoComplete is populated correctly when I start entering data, but when I submit the form, the widget has the red border meaning that it's not returning the int property type but the string type.

These are two of the AutoComplete properties on my model that I need to bind to:
[DisplayName("Vendor")]
public int? VendorId { get; set; }
 
[DisplayName("Category")]
public int CategoryId { get; set; }
Here is my Vendor AutoComplete widget:
@(Html.Kendo().AutoComplete().Name("Expense.VendorId")
    .DataTextField("VendorName")
    .Filter(FilterType.StartsWith)
    .Placeholder("Type in a Vendor...")
    .DataSource(dataSource =>
    {
        dataSource.Read(read => read.Action("_GetVendors", "Expense"));
    })
    )
Bottom line: I need to bind the Id of the selected value back to the controller, so I need to know how to return the Id from the AutoComplete widget and include it with the response.

Any help on this is appreciated.

Thanks.
King Wilder
Top achievements
Rank 2
 answered on 15 Mar 2013
1 answer
88 views
I have a Db table that has a SiteKey, SiteValue, Description columns. No Id's.
For example,
SiteKey    SiteValue
ACode     ABC
BCode     XYZ
CCode    123
I want to display this in a View
--------------------------
A Code: ABC
B Code: XYZ
C Code: 123
---------------------------
| EDIT |
----------------------------
And a Button to Edit. On click, make the display boxes for values to Inline Editing with the option to Save or Cancel.
Can you show me a sample to do this with Kendo? I am able to do this as a separate Edit View but want to use kendo widgets if possible. Since the data is unrelated, not sure what to use or if this is possible.

Annie

Dimiter Madjarov
Telerik team
 answered on 15 Mar 2013
4 answers
108 views
Hi everyone,

I'm a database engineer new to the ASP.NET MVC world, and recently purchased the Telerik Kendo UI tool kit for ASP.NET MVC in order to transition away from Silverlight. While I appreciate the thoroughness of the examples provided by Telerik, what I would have preferred is individual projects for the various tools. I'm sure those accustomed to working with MVC in general are able to cut through all the chaff and get to what they need, but all I really want is to understand how to use a basic grid for now; I'll build on that understanding later. A project/solution with just a basic grid implementation would save me a lot of time.

Does anyone know if there is a project repository on Telerik or KendoUI.com that would suit my needs? I've looked through the forums, but figured I'd start asking here before submitting a support ticket.

Thanks in advance for any help for this novice!
Nate
Top achievements
Rank 1
 answered on 15 Mar 2013
1 answer
84 views
It appears that the DEMO version for MVC, only has binary's for MVC 3.

Does the full production version ship with MVC 4 support?

I get this error:

Could not load file or assembly 'System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

My Project is MVC 4.
Atanas Korchev
Telerik team
 answered on 15 Mar 2013
2 answers
395 views
Hi,
I'm trying to use custom validation and figured out that it works not in the same way as standard one.

When I use required validation the value is validated and it is impossible to change active cell.
In case of custom validation it is possible to change current active cell. And the validation message become hidden.

For me it is important to have custom validation with the same behavior as required.

I've added example http://jsfiddle.net/ax37h/4/.
I've added required validation for the first field and add 'specialDate' validation. So both validate but the way of validation is different.

I use HtmlHelper for kendo grid creation, so I need to add validation after initialization.

Validator as below:
$('#grid').kendoValidator({
    rules: {
        specialDate: function (input) {
                    input.attr("data-specialDate-msg", "The date should be 2013-01-02");
                    return input.val() == '2013-01-02';
                }
            },
        messages: {specialDate: "The date should be 2013-01-02"}
});

Thank you.
Joakim Karlsson
Top achievements
Rank 1
 answered on 15 Mar 2013
1 answer
115 views
Hello,

We are putting together a proof-of-concept with KendoUI and ASP.NET MVC before purchasing. The specific issue I am running into is with embedding a multi-select picklist inside of a grid column. I have searched the forum and haven't found any examples of any controls embedded within another, and would greatly appreciate any examples or pointers that would speed up solving this issue.

Thanks for any responses
Petur Subev
Telerik team
 answered on 15 Mar 2013
1 answer
234 views
Hello,

We are putting together a proof-of-concept with KendoUI and ASP.NET MVC before purchasing. The specific issue I am running into is with embedding a multi-select picklist inside of a grid column. I have searched the forum and haven't found any examples of any controls embedded within another, and would greatly appreciate any examples or pointers that would speed up solving this issue.

Thanks for any responses
Georgi Krustev
Telerik team
 answered on 14 Mar 2013
3 answers
215 views
Hi,

I am new to kendo ui mvc. I have one issue. I want to customize the whole edit template in pop up.

Is it possible to open a whole cshtml view in grid edit popup? like we do to open user control (.ascx) in popup.

I want this because I want multi-column edit form with 6 or more data-bound drop-down boxes.
Vidhin
Top achievements
Rank 1
 answered on 14 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?