+ 1

Is it possible To fill all empty cells in your Datagridview with value = "0" automatically at form load.If possible please help

datagridview fill with the value "0" at form loading.

21st Jan 2018, 4:03 PM
ABDOUL RAHIM NDANE PECHOU
ABDOUL RAHIM NDANE PECHOU - avatar
3 Answers
+ 1
if you can enumerate the datagrid then yes. use a foreach. foreach(var v in datagrid.Items) v.text = "0"; this is pseudocode so I'm sorry if its not 100% correct.
23rd Jan 2018, 8:09 PM
John
John - avatar
+ 1
Ok i will try and see. There is also a default value attribute in datagridview that all empty with the value of your choice. But the problem is, it does not really fill the datatable with zero only the datagrid view is been filled.
24th Jan 2018, 5:46 AM
ABDOUL RAHIM NDANE PECHOU
ABDOUL RAHIM NDANE PECHOU - avatar
0
But l'm about to use an update sql query for that.
24th Jan 2018, 5:47 AM
ABDOUL RAHIM NDANE PECHOU
ABDOUL RAHIM NDANE PECHOU - avatar