Override [Required] Validation mouse click event

Hello,


Is there a way to override the mouse click event behavior of the grid's column ValidationRules="@(new ValidationRules { Required = true })" on EditMode.Batch?

The scenario I have is that, I have 40+ columns with 15 of are required columns. However, those required columns are scattered across the grid. Clicking/Hitting tab or shift+tab button allows you to go back and forth on columns in order. But that is not the case when you use your mouse on selecting the next record.

Shown on the snapshot below, Status and PersonnelName column are required fields that is already populated. But when I clicked the Birthdate column, it jumps to the Main Grade column which is required as well. Then it restricts me from editing other non-required columns unless I populate it with value. The same will happen on the next required field if I click again other non-required fields not only until "all" required fields are populated or I used the tab or shift+tab button.

required field validation.png

What I need to achieve is to let the grid still have the [Required] Validation rule in it and at the same time, allow me to edit the non-required columns that appears before the next required column of that same record on mouse click event. Please do note that other required fields are scattered across the grid.


Hope you can help me with this situation.


Thank you and keep safe,

Limuel


5 Replies

RS Renjith Singh Rajendran Syncfusion Team October 11, 2021 01:07 PM UTC

Hi Limuel, 

Greetings from Syncfusion support. 

We are checking this from our side. We will update you further details on October 13, 2021. 

Until then we appreciate your patience. 

Regards, 
Renjith R 



VN Vignesh Natarajan Syncfusion Team October 13, 2021 12:54 PM UTC

Hi Limuel,  

We regret for the inconvenience caused.  

We have validated the reported query at our end and we are able to reproduce the reported behavior at our end also. We need some more time to analyze the reported query further at our end. Because this is default behavior of Grid to validate the all the column values while inserting a record in batch mode. We need to validate further at our end to achieve your requirement.  So we will update you the further details in one business day (14th October 2021).  

Regards, 
Vignesh Natarajan 



VN Vignesh Natarajan Syncfusion Team October 14, 2021 11:07 AM UTC

Hi Limuel,  

Thanks for the patience.  

We would like to inform you that it is default behavior of Grid to validate the next required column on a mouse click. Because when mouse click is made while editing a cell, it will be considered a form submit and record will be saved. So while saving a record, all the required column needs to defined with a values.  

Hence we have designed the batch add operation as follow to make the user to insert value to all available required column while clicking the mouse handler in the edit mode. But you can achieve the similar (your requirement to navigate to next cell) behavior using the tab key press. This is default behavior of Grid.  

So we suggest you to achieve your requirement using Tab key press or we suggest you to define the DefaultValue to required column, so that some values will displayed and required validation will not be shown as reported.  

Refer our UG documentation for your reference 


Please get back to us if you have further queries.    

Regards, 
Vignesh Natarajan 



LB Limuel Bernasor Bacay replied to Vignesh Natarajan October 14, 2021 11:35 AM UTC

Hello Vignesh,


Thank you for your responses and effort. I greatly appreciate it.

Given your explanation above, I might move-on with the next option I have in mind. That is to use a custom validation instead of the built-in "required field" validation. I already looked in the documentation and other forum thread and can't find a direct solution. So far I can't find any yet. It will be a great help if you can provide me a sample on how to achieve since I am in a bit of time constraint and a newbie in Syncfusion component.


Appreciate your usual help and response.


Kind regards,

Limuel



VN Vignesh Natarajan Syncfusion Team October 15, 2021 09:47 AM UTC

Hi Limuel,  
 
Thanks for the update.  
 
Query: “That is to use a custom validation instead of the built-in "required field" validation. 
 
We have documented the CustomValidation documentation in our Editing topic under column validation. Kindly refer the below documentation for your reference. 
 
 
Please get back to us if you have further queries or if above feature does not achieve your requirement.   
 
Regards, 
Vignesh Natarajan 


Loader.
Up arrow icon