Lookup in DataGridView
-
I am using a DataGridView as an EventLog viewer. At the moment I just bind it to a DataTable I get from my LogQuery class. However, one of the columns is EventType, an integer, but I would like to transform this to the descriptions corresponding to event types, such as Error, Information, Warning, etc. I can't change the query used by the LoqQuery to include a join, as the data provider doesn't support this. Short of iterating the DataTable result, changing one column from int to string, and doing the lookup there, I have to do the lookup transform in the grid. I think a good start is switching off auto-creating columns and manually binding columns, then I can insert an extra column and do some slights of hand. This is the crux of my question: what can I do here? An expression column, handling a populating event and doing a lookup, iterating the grid and fixing everything once populated, etc.