Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Grid is disabled but can still select rows

Status
Not open for further replies.

mdav2

Programmer
Aug 22, 2000
363
GB
I have a grid with the following none default properties (other than the usual width, height etc):

ALLOWCELLSELECTION = .F.
HIGHLIGHTSTYLE = 2
RECORDMARK = .F.
RECORDSOURCE = tablename
RECORD SOURCE = ALIAS
SPLITBAR = .F.

I am basically using a grid for the user to select record from (search results) and then populating textboxes etc on the same form for editing.

If I set the grid ENABLED = .F. and run a refresh I can still select different rows in the grid. I was hoping the user could not change the selected row until the grid was enabled. I always assumed that setting the enabled property to .F. would stop you doing anything with an object but this doesn't seem to be the case with a grid.

Any way I can stop user selecting different rows in the grid?

Thanks,


Mark Davies
Warwickshire County Council
 
I think I found the answer (a work around really). What you need to do is:

Edit Record
===========
ALLOWCELLSELECTION = .T.
GRID.ENABLED = .F.

SAVE or CANCEL DETAILS
======================
ALLOWCELLSELECTION = .F.
GRID.ENABLED = .T.

and it will stay on the selected row and return to normal afterwards. I would have imagined like most objects disabling it would have disabled the object and everying in it but not the case in grids. I am sure there is possibly a better way to do this but I can't find it at the moment.

Mark Davies
Warwickshire County Council
 
I am basically using a grid for the user to select record from (search results) and then populating textboxes etc on the same form for editing.


Rather than using a grid, as you require no input, I would use a List Box...its easier
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top