Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Anil Sharma
  Where is Anil Sharma?
 ludhiana
 India
 Anil Sharma
 To: Ahsan Rana
  Where is Ahsan Rana?
 Lahore
 Pakistan
 Ahsan Rana
 Tags
Subject: RE: Grid Question
Thread ID: 189326 Message ID: 189361 # Views: 1 # Ratings: 0
Version: Visual FoxPro 7 Category: Grids
Date: Thursday, August 14, 2008 3:30:42 PM         
   


> > hi ahsan
> >
> > there is a property DynamicBackColor in columns object. u can write your code to give then the alternate color
> > for example...
> > iif(yourtable.field1=1,rgb(255,0,0), rgb(0,0,255))
> >
> > u can set it this individually in all columns or can do 4 all by calling setall method
> > like
> > thisform.yourgrid.setall( "dynamicbackcolor","iif(yourtable.field1=1,rgb(255,0,0), rgb(0,0,255))","column")
> >
> >
> > and secondly for your grid recordsource u can select like
> >
> > select (thisform.yourgrid.recordsource)
> > or after creating your query
> > u can do just
> >
> > MyCursorName = Alias()
> >
> > then
> >
> > select (myCursorName)
> >
> >
> >
> > Anil
> > (Fox is the solution for almost everything!!)
>
>
>
> Here is my Command which is not working
> This.SetAll("DynamicBackColor","IIF(MOD(TmpBndData.Recno(),2)=0,RGB(255,0,0),RGB(0,0,255))","Column")
>
>
> > MyCursorName = Alias()
>
> This only works if Grid RecordSourceType = 'Alias' whereas I am using 4 - SQL Statement
>
> Rgds:
> Ahsan Rana

Hell Ahsan


the command Should be like that
This.SetAll("DynamicBackColor","IIF(MOD(Recno('TmpBndData'),2)=0,RGB(255,0,0),RGB(0,0,255))","Column")

other thing u wrote this.setall so that command should be somewhere in form's
method!.

Well if u rusing sql statement is u have give the cursor name too? if not than
give to it like

select * from abc into cursor xyz

that will populate ur grid with data and that will create cursor name xyz
so u can use xyz for further calculation!. if u does include the name of
cursor in query it will make a cursor named "query"




Anil
(Fox is the solution for almost everything!!)

ENTIRE THREAD

Grid Question Posted by Ahsan Rana @ 8/14/2008 12:15:53 PM
RE: Grid Question Posted by Mike Gagnon @ 8/14/2008 12:21:10 PM
RE: Grid Question Posted by Anil Sharma @ 8/14/2008 12:41:14 PM
RE: Grid Question Posted by Ahsan Rana @ 8/14/2008 3:19:13 PM
RE: Grid Question Posted by Stefan Wuebbe @ 8/14/2008 3:26:18 PM
RE: Grid Question Posted by Anil Sharma @ 8/14/2008 3:30:42 PM
RE: Grid Question Posted by Ahsan Rana @ 8/14/2008 3:50:35 PM
RE: Grid Question Posted by Anil Sharma @ 8/14/2008 5:32:24 PM
RE: Grid Question Posted by Marcia Akins @ 8/14/2008 3:41:11 PM