Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Add combo in grid
Message
From
27/09/2007 05:12:37
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01257086
Message ID:
01257091
Views:
16
>How to add combo in grid. I want to replace cell value with combo.
>thanks

Here is one way:
Public oForm
oForm = Createobject('comboingrid')
oForm.Show

Define Class comboingrid As Form
  Top = 0
  Left = 0
  Height = 350
  Width = 620
  DataSession=2

  Add Object grdorditems As Grid With ;
    Height = 300, ;
    Left = 10, ;
    Top = 10, ;
    Width = 600, ;
    Rowheight = 19,;
    RecordSource = "orditems", ;
    Name = "grdOrditems"

  Procedure Load
    Use _samples+'Data\orditems' Order Tag order_id
    Set Multilocks On
    CursorSetProp("Buffering",5,'orditems')
  Endproc

  Procedure Init
    With This.grdorditems.Column3
      .Bound = .F.
      .ControlSource = "(Iif(Seek(orditems.product_id,"+;
        "'products','product_id'),Products.prod_name,''))"
      .Width = 170
      .AddObject('comboincol','combobox')
      With .ComboIncol
        .BoundColumn = 2
        .BoundTo = .T.
        .ColumnCount = 2
        .ColumnWidths = "180,0"
        .RowSourceType = 3
        .RowSource = "select products.prod_name,product_id"+;
          " from products into cursor crsProducts order by 1"
        .SpecialEffect = 1
        .Style = 2
        .ControlSource = "orditems.product_id"
        .Visible = .T.
      Endwith
      .CurrentControl = 'comboincol'
    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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform