I've an windows form application with a datagridview and each row is associated with it's own thread. Each thread calls different methods of an object, then logs entry, exit and other important events.
I want to display the logs corresponding to the datagridview row whenever the user clicks it. So that the selected row's messages will be displayed as running status logs.
I've thought about using Action delegate and a multiline textbox, but unsure how to filter log messages based on the particular datagridview row.
Please suggest me a method to implement this. Any help would be appreciated
Edit: The logs are to be displayed on UI in a textbox or something, not in the files which I do already. And the other thing is I want the logs to be updated continuously.
Edit2: I already have the logs appended to a string member of the row/thread and when the row is clicked, it will display the log messages saved so far. But in the thread, the string gets continuously updated with new messages. So I am looking for a way to display the running log messages which are updated in the backgroud thread.