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

Datasource and validation

1 Answer 266 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Felipe Casanova
Top achievements
Rank 1
Felipe Casanova asked on 29 Apr 2012, 06:47 PM
Is there a way to change the validation on a field in the datasource after the datasource has been bound to a grid?

These two approaches don't work although I see the properties get updated.

var datasource = $("#customers").data("kendoGrid").dataSource;
datasource.options.schema.model.fields.Forename.validation = { required: false };
datasource.options.schema.model.fields.Surname.validation.required = false;
 
$("#customers").data("kendoGrid").refresh();

1 Answer, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 02 May 2012, 05:21 PM
Hello Matt,

  The model of the data gets what you set via the dataSource options and it is not possible to change it. In order to achieve the needed functionality I would suggest to use a custom validator and to change the validation when some condition is triggered.
 

Regards,
Iliana Nikolova
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Data Source
Asked by
Felipe Casanova
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
Share this question
or