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.

Row validating

Thread ID:

Created:

Updated:

Platform:

Replies:

130105 Apr 21,2017 01:47 PM May 1,2017 12:50 AM WPF 5
loading
Tags: SfDataGrid
Amine Laïeb
Asked On April 21, 2017 01:47 PM

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 08:45 AM

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  
 
 
Regards,  
Balamurugan R  


Amine Laïeb
Replied On April 24, 2017 11:15 AM

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
Regards

Balamurugan Rajaraman [Syncfusion]
Replied On April 25, 2017 08:03 AM

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   
  

Regards,   
Balamurugan R   


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

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 12:50 AM

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


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.

;