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.
Unfortunately, activation email could not send to your email. Please try again.

CurrentCellValidating event is not executed on GridTemplateColumn

Thread ID:

Created:

Updated:

Platform:

Replies:

118082 Jan 29,2015 06:33 PM Feb 2,2015 09:55 PM WPF 1
loading
Tags: SfDataGrid
ANGEL ADRIAN VELAZQUEZ RAMOS
Asked On January 29, 2015 06:33 PM

Hi Guys,

Would sombody kindly tell me how to troubleshoot this problem?

I have a SFDataGrid which has a GridTemplaeColumn and it has a textbox on the EditTemplate, everything seems fine until I run the program; I go and select the gridtemplatecolumn, I type a value and clic on another cell in the same row; what I expected to happen is that the currentcellvalidating event should run but It doesn't. I know that I can achive this with the RowValidating event, but this is not the validation per value as I would like to have.

Thanks for your time and Regards :)

Jayapradha S [Syncfusion]
Replied On February 2, 2015 09:55 PM

Hi Ramos,

Thank you for using Syncfusion products.

We have analyzed your query and we don’t have the support for CurrentCellValidating in GridTemplateColumn. Because it is possible to extend the functionality of GridColumns with your own editor by using CellTemplate and EditTemplate of GridTemplateColumn and so unable to identify which UI Elements needs to be focused. You can  use GridRowValidatingEvent  and doing something what you need to do in GridCurrentCellvalidating Event as shown in the below code snippet,

datagrid.RowValidating += datagrid_RowValidating;

void datagrid_RowValidating(object sender, RowValidatingEventArgs args)

{

   if(datagrid.CurrentColumn is GridTemplateColumn)

      {

         // you can do something here

      }

}

By using CurrentCellActivated/CurrentCellEndEdit Event you can get the currentcell/previously edited cell of GridTemplateColumn and achieve your requirement.

datagrid.CurrentCellActivated += datagrid_CurrentCellActivated;

void datagrid_CurrentCellActivated(object sender, CurrentCellActivatedEventArgs args)

        {

            // you can get the current cell here

        }

datagrid.CurrentCellEndEdit += datagrid_CurrentCellEndEdit;

void datagrid_CurrentCellEndEdit(object sender, CurrentCellEndEditEventArgs args)

    {

            //you can get the previously edited cell when you commit the value

    }

Please find the below UG Link to get detailed explanation about Rowvalidation and CellValidation,

UG Link: http://help.syncfusion.com/UG/winrt/default.htm#!Documents/validationthrougheve.htm

The below UG link provides the list of events when you edit or exist the current cell

UG Link: http://help.syncfusion.com/ug/wpf/default.htm#!documents/editing.htm

Please let us know if you have any queries.

Regards,

Jayapradha



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.

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.

;