Search code examples
windowsvb6gridocx

Storing extra value for cells on iGrid 4


In one of my apps I'm still using the very old iGrid OCX version 4. Upgradig to iGrid 6 is currently not an option for me.

I've desperately tried to find any way to store 2 extra strings in a Cell. They should not appear as a cell text.

The first thing I tried to do was assign a class to "CellValue" instead of "CellText", but it wouldn't be accepted.

Then I tried something something really dirty: I have simply added a hundred spaces and my 2 extra string, separated by a special char so that I could split them up later.

This however resulted in "..." being displayed on the cell texts. I could work around this by assigning textdraw flags to the cell, but when I hover over the cell, the entire string is shown again. I wanted to hide it.

Updating to version 6 or even iGrid.NET (where I could simply use CellTag or assign as class to a cell) is currently not an option for me.

Thank you for any help!


Solution

  • Aaaaahhhhh. :-D I got it:

    I could simply (ab)use the "CellCtrlKey" property of a cell to store the additional strings.

    Edit: Hmmm, I can set this value, but it gets ignored, meaning when I retrieve it, it is "" again.

    I guess that is a value that can only be used when a cell is a checkbox cell.

    Edit 2: I haven't found any way, so I now use a matrix / array of string, string that stores these extra values.

    I'm also using iGrid.NET and iGrid6 in other projects, and in these versions, it's super easy, but as I explained, for this one project I can't upgrade.