Hi all,

I've had this question for long, but haven't found a solution in VFP8, I
wonder if maybe VFP9 can do something extra.

I have a table with some data that I want to show in a Grid. However the
data has codes like "F" for Phone, "X" for Fax, etc. This information is
stored in a 2-dimensional Array (discription, code). I'd like to show the
actual discription instead of the coded value in the grid ofcourse. I can't
figure out how to do it in VFP 8 without creating a cursor for it. Also I'd
prefer not using combo-boxes cause they make the grid alot "heavier" to look
at, but even with Comboboxes I didn't find a working solution. Can anybody
help with this ?

thankx !!
Xavier, CPS

Re: Show non-table value inside grid by Fred

Fred
Thu May 12 10:00:26 CDT 2005

Grids have to get their data from tables/cursors/views. That's all there is
to it.

--
Fred
Microsoft Visual FoxPro MVP


"Nuyttens Xavier" <xavier@cpsit.be> wrote in message
news:MmEge.88623$3l4.5356598@phobos.telenet-ops.be...
> Hi all,
>
> I've had this question for long, but haven't found a solution in VFP8, I
> wonder if maybe VFP9 can do something extra.
>
> I have a table with some data that I want to show in a Grid. However the
> data has codes like "F" for Phone, "X" for Fax, etc. This information is
> stored in a 2-dimensional Array (discription, code). I'd like to show the
> actual discription instead of the coded value in the grid ofcourse. I
> can't figure out how to do it in VFP 8 without creating a cursor for it.
> Also I'd prefer not using combo-boxes cause they make the grid alot
> "heavier" to look at, but even with Comboboxes I didn't find a working
> solution. Can anybody help with this ?
>
> thankx !!
> Xavier, CPS
>



Re: Show non-table value inside grid by Alan

Alan
Thu May 12 10:27:47 CDT 2005

I'll use an example for looking up a employees name.
browse is on a cursor named curAssignments
Employees are in the table Employees

1) create a form method called getEmployee()
2) in that method place the following code
if seek(curAssignments.iempid,[Employees],[iid])
lcReturn = alltrim(employee.clastname)+employee.cfirstname
else
lcReturn=[]
endif
retrurn lcReturn
3) place "thisform.getName()" as the controlsource of the column for the
employees name.

Alan
programmer
Park West Gallery


"Nuyttens Xavier" <xavier@cpsit.be> wrote in message
news:MmEge.88623$3l4.5356598@phobos.telenet-ops.be...
> Hi all,
>
> I've had this question for long, but haven't found a solution in VFP8, I
> wonder if maybe VFP9 can do something extra.
>
> I have a table with some data that I want to show in a Grid. However the
> data has codes like "F" for Phone, "X" for Fax, etc. This information is
> stored in a 2-dimensional Array (discription, code). I'd like to show the
> actual discription instead of the coded value in the grid ofcourse. I
can't
> figure out how to do it in VFP 8 without creating a cursor for it. Also
I'd
> prefer not using combo-boxes cause they make the grid alot "heavier" to
look
> at, but even with Comboboxes I didn't find a working solution. Can anybody
> help with this ?
>
> thankx !!
> Xavier, CPS
>
>



Re: Show non-table value inside grid by Nuyttens

Nuyttens
Fri May 13 05:09:46 CDT 2005

thanks ! I got a simular answer from somebody else and to my surprise (I
never thought this would work) it works fine ! Thumbs up for foxpro ;)

Greetings
Xavier


"Alan C. Sheffield" <asheffield @ park west gallery.com> schreef in bericht
news:%231ARjcwVFHA.3584@TK2MSFTNGP10.phx.gbl...
> I'll use an example for looking up a employees name.
> browse is on a cursor named curAssignments
> Employees are in the table Employees
>
> 1) create a form method called getEmployee()
> 2) in that method place the following code
> if seek(curAssignments.iempid,[Employees],[iid])
> lcReturn = alltrim(employee.clastname)+employee.cfirstname
> else
> lcReturn=[]
> endif
> retrurn lcReturn
> 3) place "thisform.getName()" as the controlsource of the column for the
> employees name.
>
> Alan
> programmer
> Park West Gallery
>
>
> "Nuyttens Xavier" <xavier@cpsit.be> wrote in message
> news:MmEge.88623$3l4.5356598@phobos.telenet-ops.be...
>> Hi all,
>>
>> I've had this question for long, but haven't found a solution in VFP8, I
>> wonder if maybe VFP9 can do something extra.
>>
>> I have a table with some data that I want to show in a Grid. However the
>> data has codes like "F" for Phone, "X" for Fax, etc. This information is
>> stored in a 2-dimensional Array (discription, code). I'd like to show the
>> actual discription instead of the coded value in the grid ofcourse. I
> can't
>> figure out how to do it in VFP 8 without creating a cursor for it. Also
> I'd
>> prefer not using combo-boxes cause they make the grid alot "heavier" to
> look
>> at, but even with Comboboxes I didn't find a working solution. Can
>> anybody
>> help with this ?
>>
>> thankx !!
>> Xavier, CPS
>>
>>
>
>



Re: Show non-table value inside grid by Alan

Alan
Fri May 13 12:54:48 CDT 2005

Just be aware if you try to add parameters it can get twitchy. Some
datatypes work fine some just make the grid die.

I recently had a grid with 3 datetime columns that I wanted to trim the time
value from. I did not want to make 3 functions. Passing the date column
name"thisform.dateformat(curAssign.date1)" broke the grid. Passing a string
with the name of the column "thisform.dateformat([curAssign.date1])" works
fine, I just had to macro the reference in my function.

Alan.



"Nuyttens Xavier" <nuyttens@pandora.be> wrote in message
news:K1%ge.89626$He1.5463103@phobos.telenet-ops.be...
> thanks ! I got a simular answer from somebody else and to my surprise (I
> never thought this would work) it works fine ! Thumbs up for foxpro ;)
>
> Greetings
> Xavier
>
>
> "Alan C. Sheffield" <asheffield @ park west gallery.com> schreef in
bericht
> news:%231ARjcwVFHA.3584@TK2MSFTNGP10.phx.gbl...
> > I'll use an example for looking up a employees name.
> > browse is on a cursor named curAssignments
> > Employees are in the table Employees
> >
> > 1) create a form method called getEmployee()
> > 2) in that method place the following code
> > if seek(curAssignments.iempid,[Employees],[iid])
> > lcReturn = alltrim(employee.clastname)+employee.cfirstname
> > else
> > lcReturn=[]
> > endif
> > retrurn lcReturn
> > 3) place "thisform.getName()" as the controlsource of the column for the
> > employees name.
> >
> > Alan
> > programmer
> > Park West Gallery
> >
> >
> > "Nuyttens Xavier" <xavier@cpsit.be> wrote in message
> > news:MmEge.88623$3l4.5356598@phobos.telenet-ops.be...
> >> Hi all,
> >>
> >> I've had this question for long, but haven't found a solution in VFP8,
I
> >> wonder if maybe VFP9 can do something extra.
> >>
> >> I have a table with some data that I want to show in a Grid. However
the
> >> data has codes like "F" for Phone, "X" for Fax, etc. This information
is
> >> stored in a 2-dimensional Array (discription, code). I'd like to show
the
> >> actual discription instead of the coded value in the grid ofcourse. I
> > can't
> >> figure out how to do it in VFP 8 without creating a cursor for it. Also
> > I'd
> >> prefer not using combo-boxes cause they make the grid alot "heavier" to
> > look
> >> at, but even with Comboboxes I didn't find a working solution. Can
> >> anybody
> >> help with this ?
> >>
> >> thankx !!
> >> Xavier, CPS
> >>
> >>
> >
> >
>
>



Re: Show non-table value inside grid by Jeff

Jeff
Fri May 13 14:37:55 CDT 2005

This is a great solution. Do you think it will work for dynamicbackcolor and
dynamicforecolor as well?

I have a table whose data is shown in a grid. It is related to another table
using SET RELATION and the data in this second table is used to set the
DynamicForeColor and DynamicBackColor on some of the column.

This works perfectly on some workstations, ok on others, and not at all on a
few workstations. Lets say the table being gridded is A and the related
table is B. I'll have a DynamicForeColor set to

iif(B.Logical, RGB(whatever), RGB(whatever))

I certainly could make a function that returns B.Logical and then code

iif(BFunc(), RGB(whatever), RGB(whatever))

Is there any reason to believe that this will have fewer problems?

Thanks,

Jeff

"Alan C. Sheffield" <asheffield @ park west gallery.com> wrote in message
news:%231ARjcwVFHA.3584@TK2MSFTNGP10.phx.gbl...
> I'll use an example for looking up a employees name.
> browse is on a cursor named curAssignments
> Employees are in the table Employees
>
> 1) create a form method called getEmployee()
> 2) in that method place the following code
> if seek(curAssignments.iempid,[Employees],[iid])
> lcReturn = alltrim(employee.clastname)+employee.cfirstname
> else
> lcReturn=[]
> endif
> retrurn lcReturn
> 3) place "thisform.getName()" as the controlsource of the column for the
> employees name.
>
> Alan
> programmer
> Park West Gallery
>
>
> "Nuyttens Xavier" <xavier@cpsit.be> wrote in message
> news:MmEge.88623$3l4.5356598@phobos.telenet-ops.be...
>> Hi all,
>>
>> I've had this question for long, but haven't found a solution in VFP8, I
>> wonder if maybe VFP9 can do something extra.
>>
>> I have a table with some data that I want to show in a Grid. However the
>> data has codes like "F" for Phone, "X" for Fax, etc. This information is
>> stored in a 2-dimensional Array (discription, code). I'd like to show the
>> actual discription instead of the coded value in the grid ofcourse. I
> can't
>> figure out how to do it in VFP 8 without creating a cursor for it. Also
> I'd
>> prefer not using combo-boxes cause they make the grid alot "heavier" to
> look
>> at, but even with Comboboxes I didn't find a working solution. Can
>> anybody
>> help with this ?
>>
>> thankx !!
>> Xavier, CPS
>>
>>
>
>



Re: Show non-table value inside grid by Alan

Alan
Fri May 13 15:45:08 CDT 2005

I have used methods for a dynamicback color.

I was doing the entire grid so I used setall() to set all the columns to
"thisform.gridbackcolor()". Needless to say you can do anything you need to
in the method and its easier to manage when you have more then 2 options.


Alan

"Jeff Grippe" <jgrippe@hilldun.com> wrote in message
news:118a0hk1sc8i86f@news.supernews.com...
> This is a great solution. Do you think it will work for dynamicbackcolor
and
> dynamicforecolor as well?
>
> I have a table whose data is shown in a grid. It is related to another
table
> using SET RELATION and the data in this second table is used to set the
> DynamicForeColor and DynamicBackColor on some of the column.
>
> This works perfectly on some workstations, ok on others, and not at all on
a
> few workstations. Lets say the table being gridded is A and the related
> table is B. I'll have a DynamicForeColor set to
>
> iif(B.Logical, RGB(whatever), RGB(whatever))
>
> I certainly could make a function that returns B.Logical and then code
>
> iif(BFunc(), RGB(whatever), RGB(whatever))
>
> Is there any reason to believe that this will have fewer problems?
>
> Thanks,
>
> Jeff
>
> "Alan C. Sheffield" <asheffield @ park west gallery.com> wrote in message
> news:%231ARjcwVFHA.3584@TK2MSFTNGP10.phx.gbl...
> > I'll use an example for looking up a employees name.
> > browse is on a cursor named curAssignments
> > Employees are in the table Employees
> >
> > 1) create a form method called getEmployee()
> > 2) in that method place the following code
> > if seek(curAssignments.iempid,[Employees],[iid])
> > lcReturn = alltrim(employee.clastname)+employee.cfirstname
> > else
> > lcReturn=[]
> > endif
> > retrurn lcReturn
> > 3) place "thisform.getName()" as the controlsource of the column for the
> > employees name.
> >
> > Alan
> > programmer
> > Park West Gallery
> >
> >
> > "Nuyttens Xavier" <xavier@cpsit.be> wrote in message
> > news:MmEge.88623$3l4.5356598@phobos.telenet-ops.be...
> >> Hi all,
> >>
> >> I've had this question for long, but haven't found a solution in VFP8,
I
> >> wonder if maybe VFP9 can do something extra.
> >>
> >> I have a table with some data that I want to show in a Grid. However
the
> >> data has codes like "F" for Phone, "X" for Fax, etc. This information
is
> >> stored in a 2-dimensional Array (discription, code). I'd like to show
the
> >> actual discription instead of the coded value in the grid ofcourse. I
> > can't
> >> figure out how to do it in VFP 8 without creating a cursor for it. Also
> > I'd
> >> prefer not using combo-boxes cause they make the grid alot "heavier" to
> > look
> >> at, but even with Comboboxes I didn't find a working solution. Can
> >> anybody
> >> help with this ?
> >>
> >> thankx !!
> >> Xavier, CPS
> >>
> >>
> >
> >
>
>