We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

CurrentCellValidating and RowValidating not triggered properly in GridTemplateColumn

Hi,

This is related to a previous post https://www.syncfusion.com/forums/130022/lookup-a-control-in-a-gridtemplatecolumn-edittemplate. The suggested solution involved using a GridTemplateColumn to have different controls in a cell depending on the row data. When using GridTemplateColumn, the Validating events are not triggered as expected. The following behaviours are not expected:
  1. When double-clicking a cell in a GridTemplateColumn to enter edit mode, the RowValidating event is triggered immediately. But if edit mode was initiated with F2, the RowValidating event is triggered correctly.
  2. When edit mode is entered by double-clicking, the RowValidating event is not triggered after editing the row. Calling sfdatagrid.GetValidationHelper().SetCurrentRowValidated(false) in the changed event of the custom control used in the GridTemplateColumn is a workaround as suggested in a previous post. But calling sfdatagrid.GetValidationHelper().SetCurrentCellValidated(false) doesn't help to trigger the CurrentCellValidating event as SetCurrentRowValidated(false) does with the RowValidating event.
Could you please help me with the following:
  1. What is the best way to suppress the immediate RowValidating event in (1)? 
  2. Or can the SfDataGrid be set up to allow a double-click to behave the same way as a F2 key press?
  3. Is there a similar workaround for triggering the CurrentCellValidating event as calling SetCurrentRowValidated(false)?
I've attached the project I used to test the behaviours.

Regards,

Sam


Attachment: WPF1449676857ValidatingNotFired_25c3967d.zip

2 Replies

SC Sam Chan April 29, 2017 04:31 AM UTC

Hi,

I think I've found the answer to (c) in https://www.syncfusion.com/forums/118082/currentcellvalidating-event-is-not-executed-on-gridtemplatecolumn. Unless something has changed in the most recent version.

Regards,

Sam


MK Muthukumar Kalyanasundaram Syncfusion Team May 4, 2017 11:21 AM UTC

Hi Sam,  
 
We were able to reproduce the issue and have logged defect report regarding this. A support incident to track the status of this defect has been created under your account. Please log on to our support website to check for further updates  
 
 
Please let me know if you have any questions.  
 
Regards, 
Muthukumar K 


Loader.
Up arrow icon