Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combo in a grid
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Combo in a grid
Miscellaneous
Thread ID:
00535153
Message ID:
00535153
Views:
57
Hi everybody,

Is placing combo in a grid means asking for trouble? I have a grid on the form, which highlight the whole row. I also use DynamicForeColor in this way:
Grid:Init
dodefault()
this.setall('DynamicForeColor', "this.myforecolor(BldMstr."+thisform.AddrField+")", 'Column')
    * .Setall('Sparse',.F.)
set message to thisform.caption
Here is myForeColor method of the grid:
********************************************************************
*  Description.......: grdAddrStd.myForeColor - sets grid's forecolor depending on Status field value
*  Calling Samples...: 
*  Parameter List....: 
*  Created by........: Nadya Nosonovsky 06/29/01 11:31:54 PM 
*  Modified by.......: 
********************************************************************
lparameter tcFieldVal
local lnColor
if vartype(m.tcFieldVal)<>"C"
   tcFieldVal=evaluate('BldMstr.'+thisform.AdddrField)
endif   
* --	changed the fore color of the whole row 
* --	red = auto suspect 
* --	blue = manually resolve 
* --	green auto-correct 
* --	highlight the selected line light blue ... 
*--------------------------------------------------------------------------
local lnColor
do case
    case m.tcFieldVal='5'
         lnColor=rgb(255,0,0) && Auto-suspect
    case m.tcFieldVal='4'
         lnColor=rgb(0,128,0) && Auto-correct    
         
    case m.tcFieldVal='6' && Manually-resolved
         lnColor=rgb(0,0,255)
    otherwise
         lnColor=rgb(0,0,0) && Black
endcase
return m.lnColor
Each normal textbox in a grid I replaced with AddrInGrid class. In Town column I placed two controls: AddrInGrid (called text1) and cboTown1. In the grid Init I remove one of the objects depending on thisform.ProcType value.

Now I have a lot of troubles with this combo.

First of all, it doesn't update ccode in its InteractiveChange despite all my efforts.

Secondly, when I move focus to another field after changing a town, I (not always, but often) go to completely different row, which is not highlighted, while the old one is highlighted and placed at the bottom of the file.

Do you know, how to solve all these problems?

Thanks a lot in advance.
If it's not broken, fix it until it is.


My Blog
Next
Reply
Map
View

Click here to load this message in the networking platform