OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: Raymond Barlow on July 30, 2012, 11:02:50 AM

Title: grid onselchanged
Post by: Raymond Barlow on July 30, 2012, 11:02:50 AM
the only way a can get the grid onselchanged event to work is the change the drop down selecting click off the grid selection then reselect the grid for the event to fire.
can someone help me with this?

I am trying to have the user select a name from a dropdown in a grid control then select a date in to same grid different column to update a drawing format.
Title: Re: grid onselchanged
Post by: owenwengerd on July 30, 2012, 11:47:35 AM
Which version of OpenDCL Runtime are you using? I cannot reproduce the problem in build 7.0.0.6.
Title: Re: grid onselchanged
Post by: Raymond Barlow on July 30, 2012, 01:19:17 PM
I am using 7.0.0.6 studio
I install  7.0.0.6 run time but is there a way to check this with lisp
Title: Re: grid onselchanged
Post by: owenwengerd on July 30, 2012, 01:31:38 PM
The version is displayed in the command line when OpenDCL Runtime loads, or you can use the (dcl_GetVersionEx) (http://www.opendcl.com/HelpFiles/index.php?page=Reference/Function/GetVersionEx.htm) function.

It might be helpful if you could upload a very simple sample project and lisp code that I can use to reproduce the problem.
Title: Re: grid onselchanged
Post by: Raymond Barlow on July 30, 2012, 02:44:57 PM
thanks I am using rumtime  7.0.0.6
Here is a test sample of what I am tring to do.

thanks for all your help
feel free to make any changes as needed.
Title: Re: grid onselchanged
Post by: Raymond Barlow on July 30, 2012, 03:42:18 PM
Here is an updated example
the combo example show whats I would like to do with the grid

hope this make sense

thaks
Title: Re: grid onselchanged
Post by: owenwengerd on July 30, 2012, 04:40:09 PM
It looks like in your original code, you are calling (dcl_Grid_GetCellText format_Form1_Grid1 Row Column) and expecting that to return the value of the previously-active cell. It actually returns the value of the newly-activated cell. As best I can tell, the OnSelChanged event is working fine. So, your second version using OnEndLabelEdit appears to be the correct way to do what you want.

So, I think what you're after is for the OnEndLabelEdit to fire as soon as the dropped-down combo selection changes. For that, try changing your cell style to a dropdown list (18). The dropown list should end editing as soon as a selection is made.
Title: Re: grid onselchanged
Post by: Raymond Barlow on July 30, 2012, 05:02:06 PM
thanks for your reply and looking at my code.

changing the style to 18 does give the desired effect but I what the user to be able to type in a reply if missing from the list (see combo example)
also I was hope the date would work the same way as style 18

thanks for your time
Title: Re: grid onselchanged
Post by: owenwengerd on July 30, 2012, 05:08:52 PM
There isn't any way to get exactly what you want. Maybe you could handle OnCancelClose (which gets called when the user presses Enter) and have it just end editing instead of closing the dialog. This would make Enter a one-key shortcut to end editing and update the text box.
Title: Re: grid onselchanged
Post by: Raymond Barlow on July 31, 2012, 08:51:39 AM
How would I get it to end editing?

please and thanks
Title: Re: grid onselchanged
Post by: owenwengerd on July 31, 2012, 11:06:35 AM
You can call (dcl_Grid_CancelCellEdit) (http://www.opendcl.com/HelpFiles/index.php?page=Reference/Method/Grid/CancelCellEdit.htm) or anything that causes the active cell to lose focus.