Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid Help - Non editable columns???
Message
From
02/10/2001 13:26:02
Peter Brama
West Pointe Enterprises
Detroit, Michigan, United States
 
 
To
02/10/2001 12:52:06
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00563039
Message ID:
00563155
Views:
23
Actually focus IS switching (I had to turn the cursor on again) but the grid cell is still staying highlighted. It happens just on every other move click - it is wierd and I don't know why.


>So in the gotfocus event you have
>
>Proc gotfocus
>NODEFAULT()
>thisform.txtSearch.SetFocus()
>Return
>
>And you still have focus on the Grid??? Is that correct.
>
>
>
>>Just tried that - focus for some reason is still staying on the grid.
>>
>>
>>Pete
>>>Peter,
>>>
>>>Have you tried the NODEFAULT on the thisform.grid1.column1.text1.gotfocus event I seem to recall that did it for me
>>>when I had to do the same thing.HTH
>>>Cecil
>>>
>>>>The txtSearch box is where all typing is handled. I was going to modify the KEYPRESS for that field to control the grid. Uparrow move grid up (skip -1), downarrow move grid down (skip), enter - process for highlighted entry (bring up new form to accept data), etc.
>>>>
>>>>The original form allowed for input in a quantity field but that is confusing the staff so I needed to stop that.
>>>>
>>>>>Hi!
>>>>>
>>>>>AfterRowColChange is fired twice when you selecr another record. First time it fire just when you select a grid. You can check in grid how it if fired by checking if current recno() in the grid alias is changed compare to the old stored value.
>>>>>
>>>>>Anyway, if you cannot make it normal way, you can put a timer on form that fire each 0.1 second and chack 0 if that grid is focused - change the focus.
>>>>>
>>>>>BTW, how you're going to scroll it when it is not focused?
>>>>>
>>>>>HTH.
>>>>>
>>>>>>I tried this with a bit better result but still not 100%...
>>>>>>
>>>>>>I set:
>>>>>>thisform.grid1.readonly=.T.
>>>>>>thisform.grid1.column1.text1.gotfocus - set cursor off
>>>>>>thisform.grid1.column1.text1.gotfocus - set cursor on
>>>>>>thisform.grid1.afterrowcolchange - thisform.txtSearch.setfocus()
>>>>>>
>>>>>>The row/column highlights randomly even though it isn't suppose to. When it DOES highlight, the focus remains on the grid (without a cursor). When it DOESN'T highlight, the FOCUS goes to the txtSearch field.
>>>>>>
>>>>>>I put a wait window into the AFTERROWCOLCHANGE before the setfocus... sometimes this method fires twice, sometimes only once. When it fires twice - that is when the focus doesn't move right.
>>>>>>
>>>>>>Suggestions?
>>>>>>
>>>>>>>Hi!
>>>>>>>
>>>>>>>Why set focus outside of the grid? Just set the ReadOnly property of grid to .T. and thats enough. To hide the cursor, in the GotFocus of each control inside of grid use SET CURSOR OFF command, and use SET CURSOR ON in the LostFocus of control. make this on the class level (textbox class special for grid) so you will not need to put the code into each column.
>>>>>>>
>>>>>>>HTH.
>>>>>>>
>>>>>>>P.S. If you still want to set focus outside of the grid, try to do this in the AfterRowColChange event of the grid.
>>>>>>>
>>>>>>>>I have a grid that I use to display the current record in a table - sort of like a listbox - but I use some dynamic coloring for readability along with the headers - and this works fine.
>>>>>>>>
>>>>>>>>Now I don't want the user to be able to edit inside the grid. If they click on a grid row or column, I want the record current record to change accordingly but I want the focus to be in a textfield OUTSIDE the grid.
>>>>>>>>
>>>>>>>>I have tried to add thisform.txtSearch.SETFOCUS to each of these independantly and together in various configurations.
>>>>>>>>- thisform.grid1.click
>>>>>>>>- thisform.grid1.Column1.text1.click
>>>>>>>>- thisform.grid1.column1.text1.gotfocus
>>>>>>>>
>>>>>>>>Just when I think it might be working, the current column/row item field turns to white and I end up with an editing cursor in the field and able to change the data - can't have that.
>>>>>>>>
>>>>>>>>What am I missing?
Peter Brama
West Pointe Enterprises

VFP is getting easier but STILL alot to learn!!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform