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

BatchEdit: new row validation with ColumnValidationSettings

3 Answers 133 Views
Grid
This is a migrated thread and some comments may be shown as answers.
miksh
Top achievements
Rank 1
Iron
miksh asked on 22 Apr 2014, 01:19 PM
We try to follow the demo example in http://demos.telerik.com/aspnet-ajax/grid/examples/data-editing/batch-editing/defaultcs.aspx and found out that textbox required filed validation with ColumnValidationSettings does not work for ProductName for new rows.

Is that expected behaviour? Any workarounds?

3 Answers, 1 is accepted

Sort by
0
Accepted
Konstantin Dikov
Telerik team
answered on 23 Apr 2014, 10:29 AM
Hello Michael,

As you have correctly observed, the validation does not work for the newly added rows. This is a limitation with the current implementation of Batch edit mode, but our developers are aware of it and a fix should be introduced in one of our future releases. 

Nevertheless, for the time being, for enabling the required field validation for the new rows you could handle the client-side OnBatchEditOpened and use the following as a workaround:
<ClientSettings>
    <ClientEvents OnBatchEditOpened="OnBatchEditOpened" />
</ClientSettings>

And the JavaScript:
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">
        function OnBatchEditOpened(sender, args) {
            var validator = $telerik.findElement(args.get_cell(), "RFV_" + args.get_columnUniqueName());
            if (validator) {
                ValidatorEnable(validator, true);
            }
        }
    </script>
</telerik:RadCodeBlock>

Hope that helps.


Regards,
Konstantin Dikov
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
miksh
Top achievements
Rank 1
Iron
answered on 23 Apr 2014, 03:06 PM
Thanks Konstantin, that approach works.
Do you have a link to the ticket to follow when that feature will be implemented?

As a side note, we realized that ColumnValidationSettings works with RequiredFieldValidator only but we need to validate the input with RegularExpressionValidator so we have to use <EditItemTemplate> with validators we need.
0
Konstantin Dikov
Telerik team
answered on 25 Apr 2014, 10:51 AM
Hello Michael,

I am glad that the workaround solved the issue on your end.

As for your new question, this bug have been already fixed by our developers team and that fix will be introduced in the next official release. 

Please let me know if any further assistance is needed on this matter.


Regards,
Konstantin Dikov
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
miksh
Top achievements
Rank 1
Iron
Answers by
Konstantin Dikov
Telerik team
miksh
Top achievements
Rank 1
Iron
Share this question
or