Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combobox with a grid
Message
From
19/02/2003 09:07:38
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
19/02/2003 07:11:28
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00754861
Message ID:
00754884
Views:
23
>Hello *.*
>
>I´m using a combo with a grid but when I up or down a line the text of the combo isn´t displayed, I don´t want use RowSourceType = 6 because I don´t want to show all data from my table.
>
>What can I do ?
>
>Tanks in advance.

Not sure I understood. Combos work well in grid. ie:
oForm = Createobject('comboingrid')
oForm.Show
Read Events

Define Class comboingrid As Form
    Top = 0
    Left = 0
    Height = 371
    Width = 728
    DoCreate = .T.
    Caption = "Form1"
    Name = "Form1"
    DataSession=2

    Add Object grdorditems As Grid With ;
        ColumnCount = 5, ;
        Height = 267, ;
        Left = 59, ;
        Top = 33, ;
        Width = 613, ;
        RecordSource = "orditems", ;
        RowHeight = 27, ;
        Name = "grdOrditems"

    Procedure Load
    Use orditems
Endproc
    Procedure Init
    With This.grdorditems.Column3
        .Width = 170
        .Sparse = .F.
        .AddObject('myCombo','myCombo')
        .myCombo.Visible = .T.
        .CurrentControl = 'myCombo'
    Endwith
Endproc
    Procedure QueryUnload
    Clear Events
Endproc
Enddefine

Define Class myCombo As ComboBox
    BoundColumn = 3
    ColumnCount = 3
    ColumnWidths = "100,100,0"
    RowSourceType = 3
    RowSource = "select prod_name,eng_name,product_id"+;
                "   from products into cursor crsTemp"
    ControlSource = "Orditems.Product_id"
    FirstElement = 1
    Height = 24
    Left = 156
    NumberOfElements = 0
    Style = 2
    Top = 312
    Width = 180
    Name = "Combo1"

    Procedure KeyPress
    Lparameters nKeyCode, nShiftAltCtrl
    If nKeyCode = 24 And !Eof()
        Nodefault
        Skip
    Endif
    If nKeyCode = 5 And !Bof()
        Nodefault
        Skip -1
    Endif
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
Reply
Map
View

Click here to load this message in the networking platform