I have a DataGrid bound to a DataTable that I want to make custom columns for using a DataGridTemplateColumn, but I'm not sure how to reference the value in the cells of the DataTable. Every example I see online either binds the DataTable and doesn't change the templates, or uses a custom object and references the properties of the bound object. Does anyone know how to reference the values stored in the DataTable from within a control in the DataGridTemplateColumn?
Thanks, Brian
Edit: I see now that I can use the name of the column in the data table as the binding path. Unfortunately, I was going to try and assign the templates to the columns dynamically, so I won't know the current column's name. Is there another way to do what I am looking to do (Assign a template to each column or cell in a DataGrid programmatically)?