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

Row validating

Thread ID:





130105 Apr 21,2017 05:47 PM UTC May 1,2017 04:50 AM UTC WPF 5
Tags: SfDataGrid
Amine Laïeb
Asked On April 21, 2017 05:47 PM UTC

Hello,I'm using visual studio 2015 and .Net 4.6,when I use :var data = e.RowData.GetType().GetProperty("BarCode").GetValue(e.RowData);I get the fallowing exception  Object reference not set to an instance of an objectRegards.

Balamurugan Rajaraman [Syncfusion]
Replied On April 24, 2017 12:45 PM UTC

Hi Amine 
Thank you for contact Syncfusion support.  
We have analyzed your query “Exception while using the Row validating event”. We are not able to reproduce the reported issue in our Current Syncfusion produce version, it’s working fine in our side. We have attached the tested sample for your reference. Could you please revert us by modifying the sample to reported issue in our side and also share your Syncfusion Produce version. It will greatly helpful for us to analyze further.  
You can able to download the tested sample from the below link  
Balamurugan R  

Amine Laïeb
Replied On April 24, 2017 03:15 PM UTC

Thank you for the replay but i think I got the error of  NullException .... Object reference not set to an instance of an object because I'm using Sql databese

Balamurugan Rajaraman [Syncfusion]
Replied On April 25, 2017 12:03 PM UTC

Hi Amine   
As per your previous update, we have checked the reported problem by creating the sample with database, but we could not reproduce the reported issue in our Current product version. It is working fine from our side. We suspect that, this exception occurs if the property name provided in the RowValidating event is not to be available in the ItemSource bound to SfDataGrid. Could you please ensure this in your application? If the issue persists, then share your application or modified the sample to reproduce the reported issue to proceed further on this.   
Please refer the sample from the below link   

Balamurugan R   

Amine Laïeb
Replied On April 30, 2017 08:20 AM UTC

I'm binding my Sfdatagrid directly to SqlServer without using any MVVM, so this code solve the problem for me :

            DataRowView dr = e.RowData as DataRowView;
            if (dr != null)
                if (dr.Row["Category"] as string == null)
                    e.IsValid = false;
                    e.ErrorMessages.Add("Category", "Can't be empty");

Srinivasan Vasu [Syncfusion]
Replied On May 1, 2017 04:50 AM UTC

Hi Amine, 
Thanks for your update. 
Please let us know if you need further assistance onthis. 


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