I am working with the WPF toolkits DataGrid in code and relying on auto-generated columns. How can I convert the data bound values for a specific auto-generated column?
Option #1: do the necessary conversions when the underlying data is gathered. Option #2: create a new binding that uses a custom value converter for the column you want to work with: • Create a handler for the DataGrid’s AutoGeneratingColumn event. This event is called once for each column that is auto-generated. • In the AutoGeneratingColumn event handler, examine the e.Column.Header property to see if the column being generated is the one you want to work with (where ‘e’ is the DataGridAutoGeneratingColumnEventArgs argument). • If you have found the column you are looking for, you can create a new Binding using the appropriate path as well as assign an instance of a value converter to do the conversion process.