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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

CurrentCellValidating and RowValidating not triggered properly in GridTemplateColumn

Thread ID:





130223 Apr 29,2017 03:30 AM UTC May 4,2017 11:21 AM UTC WPF 2
Tags: SfDataGrid
Sam Chan
Asked On April 29, 2017 03:30 AM UTC


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.



Attachment: WPF1449676857ValidatingNotFired_25c3967d.zip

Sam Chan
Replied On April 29, 2017 04:31 AM UTC


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.



Muthukumar Kalyanasundaram [Syncfusion]
Replied On 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.  
Muthukumar K 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon