An alternative, and a much better solution for you is to ditch the standard DataGrid and use
syncfusion[
^]
DataGrid[
^]. They have Community Licences that won't cost you a cent.
You can read more about this in their
documentation[
^]
I am not affiliated with syncfusion nor do I use their products.