Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Refresh cell in a grid
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00535086
Message ID:
00535734
Vues:
30
>Hi!
>
>You code might not work because there are no such item in combobox or it does not match to the item you used for refresh. To your knowledge, combobox does EXACT match between value in the BoudColumn column in the list of combobox and the value in the data field or Value property. So when you added new value to the combobox list 'MyName' and assigned value to field char(25), 'MyName'==padr('MyName',25) is .F., so combobox show no value selected. The code posted by Gregory should be following:
>
>
>m.nNewValue = ...
>if( m.nNewValue <> eval(this.ControlSource) )
>  replace (this.ControlSource) with m.nNewValue
>  m.nNewValue = eval(this.ControlSource) && to get it in the exact matching format
>  * add item AFTER that
>  this.AddItem(m.nNewValue,...)
>  this.ControlSource=this.ControlSource && preferred way to refresh the combobox
>endif
>
>

This is not editable combobox, but just a drop down list. I solved the problem already by calling column2.refresh from combo InteractiveChange. I tried Gregory's code and few other combinations value=.value (Cetin's suggestion), but none worked until I put column refresh. I believe I tried column.text refresh before and it didn't work, though I'm not 100% sure, since I tried lots of different things in a time. I may return to this problem again, but for now it works.
>
>In our app we forget about editable comboboxes and just call a special editing form for each 'editable' combobox. Now all our comboboxes are drop-down combo, but in the combobox class we added a form name to call when user right click on the combobox. This form allows edit the values in the combobox list. After form call combobox is requeried using simple call to combobox.Requery and than you can set the value to new value using the above universal way I described. This require the additional rule for programmers though - use Requery method only to populate combobox list from data if it is not based on array or view, and call it in the Init of the combobox.
>
>HTH.
>
>>For instance: this form appeared in a situs order (in case of one regim, in another case it would be in OwnerAddr order). When the user changes street, the current context is lost. I have to somehow save the current context. I'm still thinking about resolution of this problem.
>>
>>Another problem, which I solved with Vlad's help (though it was my original idea too): change status of the field to Manual-Resolved only when the row changes (not to mention, that I need to re-validate the street).
>>
>>Yet another request: make a town field editable and make it as a combo for several regimes. Fine, I'm trying to implement it, but the result is very far from desirable... Just curious, did somebody use combos in a grid with ability to change value and it should update another field? It works when the combo looses focus, but not in InteractiveChange...
>>
>>I also got a weird class is in use problem with only one particular class. I didn't have it before :( I tried to clear class addringrid in commad window, which is doesn't help. I tried clear classlib addrstd.vcx, which doesn't help either. Only clear all works. What may cause this problem?
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform