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

Error after deleting cell contents

I have a grid control with decimal text input that seems to work fine until a decimal number has been entered and then deleted leaving the cell empty when I get a popup error " is not a valid decimal". I would like the user to be able to delete an incorrect entry but this error popup keeps appearing.

5 Replies

DY Deivaselvan Y Syncfusion Team April 9, 2019 09:15 AM UTC

Hi Barry, 

Thanks for using Syncfusion products. 

The reported issue may occur, if your Decimal column may be non-nullable column. So, please make your decimal column as nullable column to accept the null type. Please refer the following code example. 

DataTable(C#) 
dt.Columns.Add("Salary",typeof(decimal)); 
dt.Columns["Salary"].AllowDBNull = false; 

List(C#) 
private decimal? samplevalue; 
 
public decimal? SampleValue 
{ 
    get 
    { 
        return this.samplevalue; 
    } 
    set 
    { 
        this.samplevalue = value; 
    } 
} 


Please get back to us if you need any further assistance on this. 

Regards, 
Deivaselvan 



BA Barry April 9, 2019 09:41 PM UTC

I am not using a databound grid.


DY Deivaselvan Y Syncfusion Team April 10, 2019 11:10 AM UTC

Hi Barry, 
 
Sorry for the inconvenience caused. 
 
We have tested your reported scenario using below attached sample in your last downloaded version 17.1.0.32. But the sample is working fine as we expected. So, please let us know the below attached sample differ from your customization. It will be helpful for us to provide the solution at the earliest. 
 
 
Regards,
Deivaselvan
 



BA Barry April 12, 2019 11:31 PM UTC

Thanks. I was configuring the grid using the Designer so I deleted it completely and configured in using vb code and all is working now. Not sure why it didn't work when using the Designer.


SR Sabaridass Ramamoorthy Syncfusion Team April 15, 2019 12:46 PM UTC

Hi Barry, 
 
Thanks for your update. 
 
By default, if you are configuring the GridControl using designer or form load or constructor, it will be working fine. We suspect that issue may occur based on your code settings. 
 
Anyway we are glad to know that your reported problem has resolved. 
 
Please get back to us if you need any further assistance on this. 
 
Regards, 
Sabaridass R 


Loader.
Live Chat Icon For mobile
Up arrow icon