Re: One to many Grid Control
From: Dan Freeman (spam_at_microsoft.com)
Date: 03/01/05
- Next message: Dan Freeman: "Re: A takeoff on the "file is not open" error when saving form"
- Previous message: Dan Freeman: "Re: XP / VFP8 Status Bar useless"
- In reply to: Subhash: "One to many Grid Control"
- Next in thread: Subhash: "Re: One to many Grid Control"
- Reply: Subhash: "Re: One to many Grid Control"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 1 Mar 2005 09:24:28 -0800
The asterisks is "just the way it works" with 1-M relations and
grids/browses.
Filters don't play well with grids. You'd be better off avoiding them.
As Tom suggests, this would be better handled with two grids: one for
customers and one for jobs for that customer. I'd probably get rid of the
relation entirely and make the jobs a parameterized view. Every time the row
changes in customer, requery() the view and you're done.
Dan
Subhash wrote:
> I am trying to make One-to-Many Grid Control but am having a few
> problems. I created a form and added a Grid Control to the form. The
> Form's Data Environment has two tables, Customer and Jobfile.
> Relations set in Customer File to Customer Number in Jobfile and One
> to Many property of the Relations is set to .t.
>
> In the Grid Control I have included fields from both tables. When I
> run the form, values from Customer table are shown only for the first
> matching record in the jobfile. For all subsequent records, the grid
> column shows a bunch of astericks (***************). I tried placing
> following code in the Init event of the form and it works fine:
>
> Select Customer
> Do while !eof()
> ? Customer.Cust_no,Jobfile.jCust_no
> skip
> Enddo
>
> I don't understand as to why the code in the Init Event works fine
> but not in the Grid Control. I have checked several times and the
> control source of all the columns is set properly.
>
> Another thing. Filter property of the Cursor doesn't seem to be
> working. When I set the Filter property of the Jobfile to
> !Empty(Jobfile.jCust_no), it still shows all the records, even those
> customers that do not have a job set up in the Jobfile. However, when
> I set the same filter in the Init Event of the Cursor, it works fine.
>
> I am using VFP 6.0, OS Win XP Pro.
>
> Any help will be greatly appreciated.
>
> Thanks.
>
> Subhash.
- Next message: Dan Freeman: "Re: A takeoff on the "file is not open" error when saving form"
- Previous message: Dan Freeman: "Re: XP / VFP8 Status Bar useless"
- In reply to: Subhash: "One to many Grid Control"
- Next in thread: Subhash: "Re: One to many Grid Control"
- Reply: Subhash: "Re: One to many Grid Control"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|