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.
Syncfusion Feedback

Currency cell with cellvaluetype of system.single

Thread ID:

Created:

Updated:

Platform:

Replies:

11607 Mar 11,2004 12:05 PM UTC Mar 11,2004 02:21 PM UTC Windows Forms 1
loading
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);

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.

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

;