Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DataGridView replace value

dataGridView has column DataGridViewTextBoxColumn, that reads from my database.
I need to replace one value to another, example:

If in field "date" I have value "00.00.0000" - I need to replace it to text "absent".
How can i do this?

like image 589
user2254511 Avatar asked Nov 30 '25 03:11

user2254511


1 Answers

You have to use the DataGridView.CellFormatting event. With that you can easily format your cell and its text to whatever you need, based on its value. This example explains it in detail.

like image 93
Rob Avatar answered Dec 02 '25 16:12

Rob



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!