Using VB.Net
I want to make a datagird cell value zero instead of null
For example
Datagridview1
Id value1 value2 value3
01 null null 0
02 0 null 10
03 100 null 100
...
Expected output
Id value1 value2 value3
01 0 0 0
02 0 0 10
03 100 0 100
...
I have more than 80 columns and 100 rows, instead of checking the cell one by one any other method is available
Tried Code
Private Sub dataGridView1_CellFormatting(sender As Object, e As DataGridViewCellFormattingEventArgs)
If e.ColumnIndex = 0 AndAlso e.Value IsNot Nothing Then
If CInt(e.Value) = 0 Then
e.Value = ""
End If
End If
End Sub
The above code is not working properly, when i add the details in datagridview from database, showing null cell also.
How to make zero instead of null. Any other method or suggestion
Need VB.Net code help
You can also set it from code