×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Close a Grid by Double Clicking a Cell

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


RE: Close a Grid by Double Clicking a Cell

Hello,

just an idea : bindevent

Sorry, not near my pc.
regards
tom

RE: Close a Grid by Double Clicking a Cell

(OP)
Hi Tom,

I'll do some research and have never used it...

Thanks,
Stanley

RE: Close a Grid by Double Clicking a Cell

If you want to execute code on a double click event of an element just register a listener, like tomk3 suggested, with the BINDEVENT function.


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

Hello,

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

If columncount is -1, well, there is no grid, there are no columns, no headers, no records, no grid lines.

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

(OP)
Hi Chriss,

Quote (Chriss)

If columncount is -1, well, there is no grid, there are no columns, no headers, no records, no grid lines.

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

(OP)
Hi Tom.

I got it working and it works perfectly. I used your routine...

CODE --> Tom

FOR EACH loCol IN Thisform.myGrid.Columns
    BINDEVENT( loCol.Text1 , "LostFocus" , Thisform , "dothefocus" )
ENDFOR 

Thanks again,
Stanley

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close