Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Paul Gibson
  Where is Paul Gibson?
 Glasgow
 United Kingdom
 Paul Gibson
 To: Borislav Borissov
  Where is Borislav Borissov?
 Sofia
 Bulgaria
 Borislav Borissov
 Tags
Subject: RE: Highlighting a grid all the way
Thread ID: 396123 Message ID: 396204 # Views: 40 # Ratings: 2
Version: Visual FoxPro 9 SP2 Category: Grids
Date: Thursday, January 23, 2014 2:21:16 PM         
   


> > Hello One And All,
> >
> > I'm trying to set up a grid so when a row is clicked on the entire row is highlighted. Even if the cursor is in a field of a column. What I'm saying is right now I have it set so when I click on a row the entire row highlights blue with the exception of the field in the column I clicked on. That just stays white. And when I click on another column in that highlighted row, the field I click on turns white and the field the cursor was originally in is now properly highlighted.
> >
> > So how can I get it so all fields are highlighted in the no matter where the cursor is?
> >
> > I have each column's ReadOnly property set to TRUE because I don't want the user to edit any thing in the grid.
> >
> > Thanks for any help.
> >
> > Bob Gatto
>
> Set Grid.AllowCellSelection = .f.

This is definitely the way I would go as well, especially because it was described that the grid should be read-only, there is no reason not to have this set to .F.

There are benefits to setting that property to .F. in that when someone double-clicks (or right-clicks) on the Grid the code is executed at the grid level, not the textbox (or other control) level. This allows for much neater coding as well.

My default base grid class has AllowCellSelection = .F. as it's default setting because more often than not my grids are entirely read-only. I very occassionally allow users to edit data in the grid and sometimes I have a "Tag" column in the grid but that is rarer than just displaying data that I want the users to edit on a proper form with proper business logic coded on it.

ENTIRE THREAD

Highlighting a grid all the way Posted by Bob Gatto @ 1/22/2014 10:17:07 PM
RE: Highlighting a grid all the way Posted by Tore Bleken @ 1/22/2014 10:23:29 PM
RE: Highlighting a grid all the way Posted by Bob Gatto @ 1/22/2014 10:43:56 PM
RE: Highlighting a grid all the way Posted by Tore Bleken @ 1/22/2014 10:49:25 PM
RE: Highlighting a grid all the way Posted by David Mustakim @ 1/22/2014 10:59:56 PM
RE: Highlighting a grid all the way Posted by Jun Tangunan @ 1/23/2014 5:22:56 AM
RE: Highlighting a grid all the way Posted by Borislav Borissov @ 1/22/2014 10:52:54 PM
RE: Highlighting a grid all the way Posted by Paul Gibson @ 1/23/2014 2:21:16 PM
RE: Highlighting a grid all the way Posted by Pete Sass @ 1/22/2014 11:48:20 PM