This is a migrated thread and some comments may be shown as answers.

Entity 6 model binding - with data annotation validation

3 Answers 103 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Claus
Top achievements
Rank 1
Claus asked on 14 Jul 2014, 09:47 PM
Hi

I tried this but didn’t succeed

http://www.telerik.com/help/aspnet-ajax/grid-model-binding-and-strongly-typed-data-controls-support.html


Could you make a complete sample of this.


Thanks in
advance.

3 Answers, 1 is accepted

Sort by
0
Kostadin
Telerik team
answered on 17 Jul 2014, 10:36 AM
Hello Claus,

I prepared a small sample and attached it to this thread. Please give it a try and let me know about the result.

Regards,
Kostadin
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Claus
Top achievements
Rank 1
answered on 17 Jul 2014, 12:36 PM
HI Kostadin

Sorry, maybe i did't explain it properly.

I would like a sample of RadGrid Ajax that is model binded to a Entity Framework Database first model. decorated with data annotations so that in edit state, the data annotations make Radgrid validate user input.

My data annotation(buddy class) is e.g:

[MetadataType(typeof(KundeMetaData))]
public partial class Kunde { }
public partial class KundeMetaData
{
[ScaffoldColumn(false)]
public int ID { get; set; }

//[Display(Name = "Kunde")]
[Required(ErrorMessage = "Kunde skal udfyldes")]
[StringLength(50, ErrorMessage = "Min 4, max 50 karakterer", MinimumLength = 4)]
public string Navn { get; set; }


[StringLength(50, ErrorMessage = "Max 50 karakterer")]
public string Kontakt { get; set; }
0
Kostadin
Telerik team
answered on 22 Jul 2014, 08:02 AM
Hi Claus,

A live example could be found at the following link. Please check it out and let me know about the result.

Regards,
Kostadin
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Claus
Top achievements
Rank 1
Answers by
Kostadin
Telerik team
Claus
Top achievements
Rank 1
Share this question
or