Close a Grid by Double Clicking a Cell
Close a Grid by Double Clicking a Cell
(OP)
Hi,
I need to setup a form grid where ColumnCount = -1 to allow double clicking a cell with code to close the grid while selecting the clicked record. This is easy when ColumnCount is not -1 and code in the cell's text methods. Just not been able to get it to work with a -1 value.
Thanks,
Stanley
I need to setup a form grid where ColumnCount = -1 to allow double clicking a cell with code to close the grid while selecting the clicked record. This is easy when ColumnCount is not -1 and code in the cell's text methods. Just not been able to get it to work with a -1 value.
Thanks,
Stanley
RE: Close a Grid by Double Clicking a Cell
just an idea : bindevent
Sorry, not near my pc.
regards
tom
RE: Close a Grid by Double Clicking a Cell
I'll do some research and have never used it...
Thanks,
Stanley
RE: Close a Grid by Double Clicking a Cell
You can check the BINDEVENT documentation here:
https://fox.wikis.com/wc.dll?Wiki~BindEvent
The name of the event you have to register is "dblclick"
You can also register it from the GUI:
RE: Close a Grid by Double Clicking a Cell
basically you can add a method dothefocus to the form
after grid is initialised :
FOR EACH loCol IN Thisform.myGrid.Columns
BINDEVENT( loCol.Text1 , "LostFocus" , Thisform , "dothefocus" )
ENDFOR
or se here for more details and a maybe matching sample :
https://social.msdn.microsoft.com/Forums/sqlserver...
hth
tom
RE: Close a Grid by Double Clicking a Cell
I wonder if you overlook something in your usage of the grid. For example, that it grabs an active workarea and adds columns at runtime, if you don't do it at design time. So you use a normal grid with columncount>0 in the end.
Chriss
RE: Close a Grid by Double Clicking a Cell
This is true at design time, but not true at runtime. The only dblclick method is at the grid level at design time as there are no other grid child controls.
I'm going to play around with Tom's idea as I see looks doable.
Thanks, Stanley
RE: Close a Grid by Double Clicking a Cell
I got it working and it works perfectly. I used your routine...
CODE --> Tom
Thanks again,
Stanley