Oliver
  • Oliver
  • Advanced Member Topic Starter
2013-11-28T10:08:45Z
Hello 10Tec

It would be nice the have a .CellEditable property that controls .Editable on cell-level. It would also be interesting to have more than two values for it. One would lock the cell entirely, the second would allow editing as normal. The third would allow to enter editing mode (to be able to select-and-copy parts of the taxt in the cell) but prevent any modification to that text.
This is similar to what Access does with Locked but Enabled controls.

I know that some of this can be achieved through the various events, but it would be so much more natural to set it as a property of the cell. To avoid doing this for the entire grid, it would be good to set it in the 'column default cell', too.

Regards,
Oliver



(We newly aquired iGrid for use in our MSAccess Projects. These are some things i found. I will post each one in a seperate topic, so they can be tracked easily)
Igor/10Tec
2013-11-29T09:48:25Z
Thank you for your suggestion!

Yes, you are right, the ability to protect a cell from editing is present in iGrid ActiveX since its first versions and is done with the help of the RequestEdit event. In contrast to a CellEditable property, it gives us the ability to decide whether a cell should be editable on-the-fly.

Quote:

The third would allow to enter editing mode (to be able to select-and-copy parts of the taxt in the cell) but prevent any modification to that text.



An interesting option, but you can get this functionality in the current version of iGrid today. You need to use the BeforeCommitEdit event for that - allow editing of your locked cells, but then simply reject any user changes they may have made by setting the eResult argument of this event to 'igEditResCancel'.

For a better effect, you can also suppress all text input in the TextEditKeyPress event too.
Oliver
  • Oliver
  • Advanced Member Topic Starter
2013-11-29T11:37:24Z
Hmm, I will try the TextEditKeyPress event. Maybe that will do what I intended.
Oliver
  • Oliver
  • Advanced Member Topic Starter
2013-11-29T14:32:20Z
Almost got it :)
I can suppress most, but not all changes via TextEditKeyPress-Event. What I cannot do here is prevent "select and delete" and Ctrl-v. These still get inserted. I can use TextEditChange-Event additionally and set

objGrid.TextEditText = Nz(objGrid.CellValue(lRow, lCol), "")

on the cells which i want to lock. That kinda works. Just feels a little heavy.

Igor/10Tec
2014-08-22T07:20:18Z
One more thought about the ability to copy cell text but not edit it. When iGrid is not in edit mode, you can simply press CTRL+C to grab the current cell text. Yes, you get the full text, but you can cut off what you don't need later. No need in this 3rd read-only-edit-mode.