The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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
ADAdministrator Syncfusion Team 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);