Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grids and Combos Redux
Message
From
03/03/1999 10:33:51
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00193392
Message ID:
00193582
Views:
17
Well, I've thought occasionally about using an array instead of a cursor or table, but I don't think that's where my problem is ... the dropdown fires ok and shows my RowSource rows without a problem.

Bonnie

>Bonnie,
>
>Provided you are talking about less than 500-600 names I'd use an array as the RowSource of the cbo. My lowest level cbo subclass adds an array property to the cbo to make life easier. The array could also be a property of your form if you don't want to create a cbo subclass. You can use a SQL statement to populate the arra initially:
>
>
* property settings:
>RowSource=this.maList
>RowSourceType=array
>ControlSource=ClinicRoles.PeopleID && ? whatever the grid table column is
>BoundTo = .t.
>BoundColumn=2
>
>* cbo.Init method
>select name, peopleid ;
>   from clinic_people ;
>   into array this.maList ;
>   order by name
>this.Requery() && tells cbo to reread it's RowSource
>
>>Hey Gang,
>>
>>I have a grid based on a table, ClinicRoles (that is the RecordSource). Column 1 of the grid holds a field from this table, the TaskName.
>>
>>ClinicRoles is related to Clinic_People (on the RoleID field, numeric). Clinic_People displays 3 columns in the grid (2 date fields and a checkbox).
>>
>>Clinic_People is related to People (on the PeopleID field, numeric). A DisplayName field in People is displayed in another column using a ComboBox so that the user may choose a person from the People table to be associated with that particular TaskName. The person's ID number (People.PeopleID) is stored in the Clinic_People.PeopleID field. Originally I was using the People table as the RowSource for the combo, but that wouldn't work because it has to be sorted alphabetically, and the People table has to be indexed on PeopleID because of the relationships. The relationships have to exist (as near as I can figure out anyway) so that it all displays correctly in the grid, so I've created a cursor for the RowSource to the combo, curGridPeople.
>>
>>So far, so good and it seems to work except under one condition ... and that is when no person has been chosen yet. Clinic_People.PeopleID is 0, so that People is at EOF() and the combo becomes read-only, even tho the ControlSource (Clinic_People) is not at EOF() *and* the RowSource, the cursor curGridPeople, is not at EOF(). Here it is in a nutshell:
>>
>>Column 3
>>BoundTo = .F.
>>ControlSource = People.DisplayName
>>
>>Combo (in column 3)
>>BoundColumn = 2
>>BoundTo = .T.
>>ControlSource = Clinic_People.PeopleID
>>RowSource = curGridPeople.DisplayName, PeopleID
>>
>>I can't figure out a way to make People not at EOF(). As soon as I try manually manipulating the record pointer in People (in say, the GotFocus of the combo), the Grid gets a mind of it's own and says "No Way" and goes haywire! Is this even the cause of the problem? I'm not sure, I just know that it's not working!!! Help!
>>
>>Thanks,
>> Bonnie
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform