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

Validator to make a cell disabled/not editable/read only

3 Answers 164 Views
Grid
This is a migrated thread and some comments may be shown as answers.
CS
Top achievements
Rank 2
CS asked on 30 Jun 2014, 12:10 PM
I want to configure a validator so that when I fill a cell with a correct value and leave the cell, that cell should be locked and not be touched again. The problem is how to mark those cells that are read only and how to save a list so that with every call every user has the read only cells.

3 Answers, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 02 Jul 2014, 06:40 AM
Hi Stefan,

From the provided information it's not clear for us what is the exact scenario that you have - could you please provide the current grid code that you are using? This way we will get better overview of the exact setup that you have and advice you better if the required behavior is possible in your case and how to proceed.

Regards,
Vladimir Iliev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
CS
Top achievements
Rank 2
answered on 02 Jul 2014, 06:49 AM
I cannot provide a code sample since it is WIP for a customer plus it is in MS CRM hence it needs a local database and customizing and so on.
But I can try and elaborate my problem a bit more.
So I have a field, if the input of that field matches with lets say an entry of an array I want that field to be disabled for editing when the user leaves that field. Short example, I have a Product Name field and I want to disable the input when the user has typed in a valid Product Name that was found in an array of products, or in a database for example. So if you add a new record then type in a valid Product Name and you leave the cell, then the validator should go and check if it is a valid Product Name or not, if it is, the user should not be able to change it again.
Reason behind this is, I have a product in MS CRM, and that product is a part of an salesorderdetail, when you create a salesorderdetail with a product it automatically gets certain properties from the product, but if I update the salesorderdetail with a different product that does not update those prefetched values hence, I end with wrong product properties so I need to prevent updating of products.
0
Accepted
Vladimir Iliev
Telerik team
answered on 03 Jul 2014, 08:59 AM
Hi Stefan,

The desired behavior is not supported out of the box and it will require custom solution based entirely on you and the exact setup that you have.
For example you can define custom validation rule (in dataSource schema.model.fields.fieldName.validation) in which to perform your custom check and if the current editor should be locked to include current row ID and current field name in global variable. Then for example using the "edit" event of the grid you can disable/remove the needed editors based on the variable created in previous step.

Regards,
Vladimir Iliev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
CS
Top achievements
Rank 2
Answers by
Vladimir Iliev
Telerik team
CS
Top achievements
Rank 2
Share this question
or