Hello, hope all are fine!
I have question, how i can add str(“$”) to a integers columns on datatable that it will be show on datagrid
Thank you!
You cannot add non-numbers to a number column on a data table. And you don’t want to.
What you want to do is when you display the data to add the appropriate symbols. That happens in the data binding on the data grid. Normally you’d bind the text
property to something like self.item['foo']
, but you can put anything in that data binding that would generate a string, e.g. f"${self.item['foo']}"
If you’re not familiar with the f
string syntax, that’s standard Python. Read up on it, it’s super useful when you need to mix variables and text.
1 Like
You are genius, thank you!
1 Like