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: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

CurrentCellValueChangedEvent is fired without value change on columns of type GridTemplateColumn

Thread ID:

Created:

Updated:

Platform:

Replies:

147634 Sep 18,2019 10:28 AM UTC Sep 24,2019 06:05 AM UTC WPF 3
loading
Tags: SfDataGrid
Miquel
Asked On September 18, 2019 10:28 AM UTC

Hello Syncfusion,

I have a grid with a column of type GridTemplateType like this

<syncfusion:GridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Code}" VerticalAlignment="Center" />
</DataTemplate>
</syncfusion:GridTemplateColumn.CellTemplate>

<syncfusion:GridTemplateColumn.EditTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBox Text="{Binding Code}" TabIndex="0"/>
<syncfusion:ButtonAdv Grid.Column="1"
SizeMode="Small" 
SmallIcon="/oculus;component/Assets/search-24.png"
Margin="0.5,0,0,0"
TabIndex="1"
Command="{Binding Find}"/>
</Grid>
</DataTemplate>
</syncfusion:GridTemplateColumn.EditTemplate>


The problem is each time you ends editing of a cell, although no changes are made, the CurrentCellValueChangedEvent is triggered.

Thanks.

Miquel Juan


Susmitha Sundar [Syncfusion]
Replied On September 19, 2019 05:23 PM UTC

Hi Miquel, 
 
Thank you for using Syncfusion control. 
 
In GridTemplateColumn, we can load any controls and we can’t find the triggering of the value changing from that controls. So we have raised the CurrentCellvalueChanged event manually from GridTemplateColumn. 
 
You can  restrict this behaviour by overriding the OnEditingComplete() method in GridCellTemplateRender. Please refer the below code snippet. 
C#: 
  this.sfdatagrid.CellRenderers.Remove("Template"); 
  this.sfdatagrid.CellRenderers.Add("Template",new GridCellTemplateRenderExt()); 
 
   public class GridCellTemplateRenderExt : GridCellTemplateRenderer 
 { 
     protected override void OnEditingComplete(DataColumnBase dataColumn, FrameworkElement currentRendererElement) 
     { 
          
     } 
 } 
 
 
Please revert to us back, if you need further assistance. 
 
Regards, 
Susmitha S 


Miquel
Replied On September 23, 2019 08:36 AM UTC

Thank you. Works perfectly!!.

Farjana Parveen Ayubb [Syncfusion]
Replied On September 24, 2019 06:05 AM UTC

Hi Miquel, 
 
Thanks for the update. 
 
We are glad to know that the reported problem has been resolved at your end. Please let us know if you have any further queries on this. We are happy to help you. 
 
Regards, 
Farjana Parveen A 


CONFIRMATION

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

This page will automatically be redirected to the 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

Live Chat Icon For mobile
Live Chat Icon