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

Currency cell with cellvaluetype of system.single

Thread ID:





11607 Mar 11,2004 12:05 PM UTC Mar 11,2004 02:21 PM UTC WinForms 1
Tags: GridControl
Philip Bishop
Asked On March 11, 2004 12:05 PM UTC

Ok i have a question about something I have either forgotten or never knew to begin with. If you have a coulmn and have it set to currencycell and have the cellvaluetype set to system.single how come the cells arent defaulted to zero. Like in one instance i set only 2 cells in a column of 10 rows to have data. If i try and loop through all 10 and compare each cell to greater then zero i get the casting error because the other 8 cells have null values in them. By default wouldnt a system.single be set to zero? Thanks Phil

Administrator [Syncfusion]
Replied On March 11, 2004 02:21 PM UTC

If you are using VB, you can use the Val function to return zero when the value in the cell is the empty string which is what is being displayed when there is no value in the cell. dim d as double = Val(Me.grid(4, 2).Text) will return zero when the cell is empty and will return the value when it is not. If you are using C#, then you will have to conditionally handle this situation. double d = (this.grid[4,2].Text.Length == 0) ? 0 : double.Parse(this.grid[4,2].Text);


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

This page will automatically be redirected to the 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

Live Chat Icon For mobile
Live Chat Icon