Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Chris Chamberlain
  Where is Chris Chamberlain?
 GL6 0PN
 United Kingdom
 Chris Chamberlain
 To: Russell Hill
  Where is Russell Hill?
 Sydney
 Australia
 Russell Hill
 Tags
Subject: RE: Backcolor in a Grid
Thread ID: 268861 Message ID: 268899 # Views: 32 # Ratings: 0
Version: Visual FoxPro 9 Category: Grids
Date: Thursday, July 15, 2010 9:42:34 AM         
   


> Hi all,
>
> I have a Calendar that is based on a Grid obect.
>
> The Grid has 6 rows and 7 columns.
>
> I've locked it into a Grid-driven system of related data.
>
> When I select a date in the Calendar the appearance of the selected cell (which, as far as I can tell, is determined by the Text1.SelectedBackColor property of the Column object) is fine if there is no data detected (see below).
>
>
>
> I have bound a method to Text1.Click of all the columns that executes a query using SQL (populating each of the related Grids) when there is data detected.
>
> The problem is that the selected cell in the Calendar is no longer highlighted (see below) when there IS data detected. I think this is simply because the Grid has lost focus, whereas it hasn't in the situation where no data is detected.
>
>
>
> Does anyone have any suggestions as to how I would get the highlight to remain even in the case where SQL is executed? I need the RHS Grid to have focus (it's .AfterRowColChange method drives another Grid lower down) so the simple solution of returning focus to the Calendar Grid is no good to me.
>
> Any suggestions would be appreciated.
>
> Thanks,
>
> Russell.

Hi Russell

Suggest you investigate the use of the .DynamicCurrentControl property of a grid's column.

In your situation, you could remove the .RecordSource for each column and assign a grid method to the .DynamicCurrentControl property in each column, such as

THISFORM.grid1.Column1.DynamicCurrentControl = THIS.mColumn1Colours()

In each method for each column you can then determine fore/background colours for individual cells

This FAQ, not answering your specific question, might get you started:-

http://www.tek-tips.com/faqs.cfm?fid=624

I use the technique to create multi-columned thumbnail image grids, whereby users can select cells at random, each selected thumbnail image being highlighted.

Chris

www.motrac.co.uk
www.pdfcommander.com

ENTIRE THREAD

Backcolor in a Grid Posted by Russell Hill @ 7/15/2010 4:50:58 AM
RE: Backcolor in a Grid Posted by Rahul Maudgill @ 7/15/2010 6:15:39 AM
RE: Backcolor in a Grid Posted by Russell Hill @ 7/15/2010 7:58:15 AM
RE: Backcolor in a Grid Posted by Rahul Maudgill @ 7/15/2010 11:59:28 AM
RE: Backcolor in a Grid Posted by Russell Hill @ 7/15/2010 1:43:08 PM
RE: Backcolor in a Grid Posted by Chris Chamberlain @ 7/15/2010 9:42:34 AM
RE: Backcolor in a Grid Posted by Russell Hill @ 7/15/2010 11:31:11 AM
RE: Backcolor in a Grid Posted by Cetin Basoz @ 7/15/2010 11:44:08 AM
RE: Backcolor in a Grid Posted by Russell Hill @ 7/15/2010 1:45:27 PM