Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid Help - Non editable columns???
Message
 
 
À
02/10/2001 12:05:46
Peter Brama
West Pointe Enterprises
Detroit, Michigan, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00563039
Message ID:
00563113
Vues:
26
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?
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform