DataGridView text -> image
-
Hi, I have a dgv that is created programmatically and bind it to a datatable. The Columns/Cells are all text. I insert an int (as a string) into a cell when I need to and use that int to lookup another datatable when I need to. Works well :) What I would like to do is dislay an image if the cell contains an int rather than the int itself. I know I can make the columns concerned image cells and I presume I would then need to record the image name in the datatable rather than the int which is what I want. I thought of using the cell.tag to hold the int but I need that field for another purpose. I'm not even certain that is what I want because I need to store the int, not the image name. Is there someway of using the cellformating event to convert that cell into an image cell and show an image? I think it should be possible but can't find the right code. TIA,
Glen Harvy
-
Hi, I have a dgv that is created programmatically and bind it to a datatable. The Columns/Cells are all text. I insert an int (as a string) into a cell when I need to and use that int to lookup another datatable when I need to. Works well :) What I would like to do is dislay an image if the cell contains an int rather than the int itself. I know I can make the columns concerned image cells and I presume I would then need to record the image name in the datatable rather than the int which is what I want. I thought of using the cell.tag to hold the int but I need that field for another purpose. I'm not even certain that is what I want because I need to store the int, not the image name. Is there someway of using the cellformating event to convert that cell into an image cell and show an image? I think it should be possible but can't find the right code. TIA,
Glen Harvy
May use on item data bound event and create a new image cell and by downcasting paste it to the cell u want
Mikail Çetinkaya . The C# DEveloper
-
May use on item data bound event and create a new image cell and by downcasting paste it to the cell u want
Mikail Çetinkaya . The C# DEveloper
Any chance of you speaking in C#? :) I would really appreciate a code snippet. Thanks.
Glen Harvy