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
close icon

CurrentCellValidating event is not executed on GridTemplateColumn

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 :)

1 Reply

JS Jayapradha S Syncfusion Team February 3, 2015 02:55 AM UTC

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



Loader.
Live Chat Icon For mobile
Up arrow icon