I have a datagrid which is defined at the beginning
DataGrid dtgWatch;
and linked to a Dataset dtsWatch;
dtgWatch.ItemsSource = dtsWatch.Tables[0].DefaultView;
in the middle the dataset is filled with rows with
dtsWatch.Tables[0].Rows.Add(string1, string2);
The purpose is something like the following tab:
| string1_A | string2_A |
| string1_B | string2_B |
| string1_B | string2_C |
that works properly. Now the change: at a point of that reasoning (and only for one row) I have to put an image and not a string. That means:
| string1_A | string2_A |
| string1_B | Image2_B | <---------------
| string1_B | string2_C |
Theoretically speaking this should work (no compilation error) for in case of the image I am adding the line with
Image img =...
dtsWatch.Tables[0].Rows.Add(string1, img);
but the result is
| string1 | System.Windows.Controls.Image |
A possible solution I have thought of is to put a marker somewhere and then at the runtime (Loading row event or something like that) to change the content of the cell with the image. Unfortunately I could do that for I could get to directly access and modify the cell.
I am doing all that with C# wpf with the appdomain tecnique. That means that I have not xaml, I have to do everything in code behind. All what I have is a grid to add with the datagrid.
I have tried that but it is not completed and all the other solutions I found were implying the use of a xaml
Thanks for any help
Patrick