Format binding content of auto generated columns

Sep 23, 2009 at 5:44 AM


I am binding a DataTable to a WPF DataGrid (ItemSource) and columns will be generated automatically based on the DataTable.

However, I need to format some columns lengths once they are gone beyond 100.

I have used IValueConverter's Convert method to format of data binding, but I had to change the datasource as columns are auto generated.

Is there a way to do this without changing the datasource. In fact, I need to do the formatting only when displaying without committing those formatting into DataSource (DataTable)