October 29, 2007, 10:02 AM
John_EdwardsMaintain Grid -- Can you put images in a cell?
Does anyone know of a way to link to images in a Grid cell?
J.
October 29, 2007, 10:36 AM
GamPThe Grid object being an ocx (aka active-x) control, I doubt that this will be possible.
You might get it to work with an htmltable object. One of the stack fields that you put into the htmltable should then contain the html-code to call the image.
Never tried it, but it may actually work.
October 29, 2007, 03:13 PM
Maintain WizardI would have bet that this wasn't possible. And, I'm really not sure of the ramifications, but here is the code:
function OnButton1_Click ( ) {
index = Form1.Grid1.AddBitmap("c:/ibi/apps/appname/pic1.bmp");
Form1.Grid1.GetCell(1,1);
Form1.Grid1.SetColWidth(1, 300);
Form1.Grid1.SetRowHeight(1, 300);
Form1.Grid1.CellSetBitmap(index);
Form1.Grid1.SetCell(1,1);
Form1.Grid1.RedrawAll();
}
You use the AddBitMap command to get the image. I then resized the cells to make it look right and redrew the grid. The image DOES appear in a gridcell. It is a bit grainy and I am not sure if there is another way to resize it, but here is the jumping off point.
Mark
October 29, 2007, 03:55 PM
John_EdwardsThanks bud -- I missed the AddBitmap command in the help file.
J.
October 29, 2007, 03:56 PM
John_EdwardsPresumably I can use something other than the disk directory structure to reference it? I'm guessing that is just how you prototyped on your laptop.
J.
October 29, 2007, 11:17 PM
John_EdwardsI've done a lot of digging on tech support and on UG's site and it appears that referencing a bitmap on the server (which is likely the only useful thing to do given WF Maintain's architecture) is out of reach. All of the example source code shows only references to the local hard drive.
If anyone comes up with a solution to this I am all ears.
John
October 30, 2007, 09:54 AM
Maintain WizardJohn
It is very limited but it does seem that you have to have the hard coded path to the drive. I tried APPROOT and server name without any luck. Sorry.
Is there anyway you could use an HTMLTable instead of a grid? I have techniques that allow you to make selections and additions into an HTMLTable. That handles images without a problem.
Also, we are working on replacing the old Active-X grid with a new JavaScript one, but this is still some time away til production.
Mark
October 30, 2007, 10:32 AM
John_EdwardsFor the moment I am committed to the grid for this app. I can change the look of my interface a bit and introduce a simulated text hot-link instead, but I had a column where a check mark would have been exceptionally useful.
I even tried referencing the server via a file:// connection but it did not take.
John
October 30, 2007, 06:25 PM
sakeenanJohn,
Using a check box inside the grid cell may not be as pretty as a checkmark image, but it should work.
While I haven't used the grid cell check box feature, I have used the dropdown feature inside the cell and it works fine.
November 02, 2007, 02:41 PM
Dave AyersPerhaps you could find a check mark as a character in a font set, and eliminate the image issue.
But then, the issue would be if the font was available to all your applications users.