Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GPF: User defined combo box class in grid
Message
From
16/11/2001 07:27:45
 
 
To
16/11/2001 06:07:03
Alexandre Palma
Harms Software, Inc.
Alverca, Portugal
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00582300
Message ID:
00582640
Views:
44
Alexandre, I know that you know better solutions. I just want to tell that I use usually approach that is tested in production for years. I understand that newer versions of VFP can have issues with such combobox more or less fixed, or workarounds found that I did not knew about before I made that combobox class. I just want to tell that it is possible to do th same things by many different ways. This give a lot of flexibility and when one approach do not works, try another. The approach I given is just example of such way of making solutions. If you know better solutions - good for you. The point here is to do not hang on the bug as it is not avoidable. Just try another solution that do things different way producing the same result. Some way it should work, because other applications alreayd contain it working ;)

>>>there are many ways to accomplish the same result this without needing to code your combo.

Agree. the solution I proposed is the most generic and works for sure, though I could be wrong (as I said in the words above).

>for that matter then do the following when doing the statement for the combo source instead of having the id field as int convert it to Numeric(10,2) that is what the value of the combo will have if you pass an int to it, them you don't have any problem since is saved to the contacts table as int.
>there are many ways to accomplish the same result this without needing to code your combo.
>
>>Hi!
>>
>>Yes, the sample is good. But you can always write a code in combobox that will not use ControlSource, but programmatically refresh and save value converting it to character value explicitly. At least this way I workaround mentioned bug in VFP with Int-based combobox in grid. In my app I usually have a combobox class that specially works that way and also tested with grid.
>>
>>Of course, beginner programmers will still step onto this same rake, that for sure should be taken into account by MS VFP team.
>>
>>>Vlad tahe the following example a table name contacts that has one field called country tha field is a foneign key to the countrylist table this for example is working in SQL Server ang the primary key's for the tables is an identity field so being an identity is an int field now you have a grid to show the contacts and on the country field I have a comboshowing the countrys does this seems a good enoughf use case?
>>>
>>>>Hi!
>>>>
>>>>I never used combobox with Int field because it is supposed to work with character data only. Working with Int field comes from older versions of FoxPro and left for compartibility. It is not recommended to use this feature of combobox at all, because it is also confusing and less maintenable for application solutions (Int field is populated by comnbobox differently). Can you give sample of use-cases for such approach? Never had it.
>>>>
>>>>For what is worse, combobox in grid working with numeric/integer field was always buggy - this bug is described at the Russian VFP Club site (at least I have seen this forst time there).
>>>>
>>>>Because rarely used, its no wonder this cause crash.
>>>>
>>>>However, I did not seen confirmation from Andrew that these conditions are true in his application. Lets wait for his answer.
>>>>
>>>>>Hi Vlad put an Assign method to your combo and add it to the form the boundto property must be set to true and bound to an Int field.
>>>>>
>>>>>>Hi!
>>>>>>
>>>>>>I would like to look at it. Used comboboxes several times inside of the grid, and never got a GPF just because combobox. It is interesting for me. There could be also another reason. Lets see if it could be fixed/workarounded.
>>>>>>
>>>>>>>I have tried this in both VFP 6.0 and 7.0 and get the same result.
>>>>>>>
>>>>>>>I have a ComboBox class (extended from work found here on the Thread) that mimics QuickBooks interface elements. The class finally works just the way I want it to, except for one glaring problem.
>>>>>>>
>>>>>>>If I have the control on the form it works A-OK. If I put the control inside the grid as a column active control oject, I get a GPF when I run the form.
>>>>>>>
>>>>>>>I have spent a fair amount of time trying to understand/fix this problem, but do not know what else to try, so I turn to the Thread.
>>>>>>>
>>>>>>>Is there a channel whereby I can approach MS with this? If there is anybody here that would like to take a look at it, I have made a small demonstration form that I can submit.
>>>>>>>
>>>>>>>Thanks in advance,
>>>>>>>
>>>>>>>Andrew Jennings
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform