Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid with ComboBox not showing
Message
From
23/02/2018 13:28:38
 
 
To
23/02/2018 10:10:38
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Miscellaneous
Thread ID:
01658402
Message ID:
01658413
Views:
51
All code is in grid.init.make column.controlsource="" (combo built with additem...)
Public oform
oform=Newobject("Grid_combo")
oform.Show
Return
*
Define Class Grid_combo As Form
  Top = 0
  Left = 0
  Height = 389
  Width = 778
  Caption = "Form1"
  Name = "Form1"

  Add Object grid1 As Grid With ;
    Height = 385, ;
    Left = 0, ;
    Top = 3, ;
    Width = 781, ;
    Name = "Grid1"

  Procedure grid1.Init
    Sele * From Home(1)+"samples\data\customer" Into Cursor ycurs
    With This
      .RecordSource="ycurs"
      .RecordSourceType=1
      .GridLines=0
      .DeleteMark=.F.
      .RowHeight=24
      With .column2
        .Width=80
        .AddObject("combo1","combobox")
        .CurrentControl="combo1"
        .Sparse=.F.
        .ControlSource=""   &&important

        With .combo1
          For i=1 To 10
            .AddItem (Trans(i))
          Endfor
          .ListIndex=1
          .Style=2
          .Visible=.T.
        Endwith
        .Refresh

      Endwith
      .SetAll("DynamicBackColor", "IIF(MOD(RECNO( ), 2)=0, RGB(255,255,255) , RGB(167,255,210))", "Column")
      .Refresh
    Endwith
  Endproc


Enddefine
*
*-- EndDefine:grid_combo
Previous
Reply
Map
View

Click here to load this message in the networking platform