Change color of datagrid cell from code behind using datatable

25 Views Asked by At

I have an datagrid with a binding to a datatable because i read csv files and i never know how many columns i need and whats name it have when user set the csv settings to UseFileHeader. To fill the datatable with the data of the file is no problem and it works fine. If the file is loaded the user can select a verification method to verify the file content. If the verification find issues in the "cells" i want to change the color of the datagrid cell. I have read many posts about datagrid but i don't find a solution.

My idea was to set a custom class to the DataRow to get a flag by a property isValid = true/false to change the color by a converter but it doesn't work because the DataRow needs strings. Is there any way to solve this problem or i need an other data source for the datagrid?

0

There are 0 best solutions below