Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid Help - Non editable columns???
Message
From
02/10/2001 12:05:46
Peter Brama
West Pointe Enterprises
Detroit, Michigan, United States
 
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00563039
Message ID:
00563112
Views:
16
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