Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dynamic CurrentControl on a grid
Message
De
04/10/2004 12:07:54
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
04/10/2004 10:20:05
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00948462
Message ID:
00948496
Vues:
20
>I am trying to get a column on a grid to either have a textbox or a combobox on each row depending on data in a specific field. If a driver has been assigned, the column shows the driver, if not, a combo box is displayed with the driver names.
>
>I can't seem to get this to work, its either all of one or the other.
>
>Is what I'm trying to do possible?
>
>Thanks,
>Larry MOrelli

Of course possible. Highly probable you set Dynamic expression wrong. ie:
Public oForm
oForm = Createobject('myForm')
oForm.Show


Define Class myForm As Form
  DataSession = 2
  Add Object myGrid As Grid With RowHeight = 25

  Procedure Load
    Create Cursor Assignments (Assigned l, Driver c(40))
    Insert Into Assignments Values (.F.,'')
    Insert Into Assignments Values (.T.,'Joe Doe')
    Insert Into Assignments Values (.F.,'')
    Insert Into Assignments Values (.F.,'')
    Locate
  Endproc

  Procedure Init
    With This.myGrid.Columns(2)
      .AddObject('myCombo','ComboBox')
      With .myCombo
        .RowSourceType=3
        .RowSource="Select First_name-(' '+Last_Name) as Driver"+;
                   " from employee into cursor crsDrv"
        .Visible = .T.
      Endwith
      *      .DynamicCurrentControl = "(Iif(Assignments.Assigned,'text1','myCombo'))"
      .DynamicCurrentControl = "(Iif(!Empty(assignments.Driver),'text1','myCombo'))"
      *      .Sparse = .f.
    Endwith
  Endproc
Enddefine
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform