1

Konu: Grid içinde ENTER

Grid'de kolon içerisinde combobox kullanıyorum değişim yapıldıktan sonra entere basıldığında aşağı inmesini istiyorum (Hızlı Girişin olabilmesi için)  fakat ne yaptıysam başaramadım belki bir özelliği vardır ama bulamadım yardımınız lazım.

Defaultta entere basılınca sağa kayıyor ben bir alt satıra düşmesini istiyorum

2 Son düzenleyen, cetinbasoz (28.01.2011 13:26:57)

Re: Grid içinde ENTER

Visual Fox Pro
* keypress

lparameters nKeyCode, nAltShiftCtrl
if m.nKeyCode = 13
  nodefault
  keyboard '{DNARROW}'
endif

3 Son düzenleyen, sasmazali (28.01.2011 13:39:23)

Re: Grid içinde ENTER

Çetin abi bunu daha önce denedim fakat combobox kullandığım için alt yön ok tuşu comboda bir sonrakine değee seçimine neden oluyor.

4

Re: Grid içinde ENTER

Gene dene.

5

Re: Grid içinde ENTER

denedim olmuyor malesef

6

Re: Grid içinde ENTER

Tamam sen de haklisin, dil surcmesi skip diyecegime dnarrow demisim:


Visual Fox Pro
Public oForm

oForm = Createobject('comboingrid')
oForm.Show
 
Define Class comboingrid As Form
  Top = 0
  Left = 0
  Height = 350
  Width = 620
  DoCreate = .T.
  Caption = "Form1"
  Name = "Form1"
  DataSession=2
 
  Add Object grdorditems As Grid With ;
    Height = 300, ;
    Left = 10, ;
    Top = 10, ;
    Width = 600, ;
    RecordSource = "orditems", ;
    RowHeight = 27, ;
    Name = "grdOrditems"
  Add Object cmdAdd As CommandButton With ;
    Top = 320, Left = 10, Caption = 'Add'
 
  Procedure Load
    Use _samples+'Data\orditems' Order tag order_id
    Set Multilocks On
    CursorSetProp("Buffering",5,'orditems')
  Endproc
 
  Procedure Init
    With This.grdorditems.Column3
      .Width = 170
      .Sparse = .F.
      .AddObject('myCombo','myCombo')
      .myCombo.Visible = .T.
      .CurrentControl = 'myCombo'
    Endwith
  Endproc
 
  Procedure cmdAdd.Click
    Local luNewOrderID, lnLineNo
    luNewOrderID = orditems.Order_ID
    Select orditems
    Count For Order_ID = m.luNewOrderID To m.lnLineNo
    Insert Into orditems ;
      (Order_ID,line_no) ;
      values ;
      (m.luNewOrderID,m.lnLineNo+1)
    Thisform.grdorditems.SetFocus()
  Endproc
Enddefine
 
Define Class myCombo As ComboBox
  BoundColumn = 3
  ColumnCount = 3
  ColumnWidths = "150,150,0"
  RowSourceType = 3
  RowSource = "select prod_name,eng_name,product_id"+;
    " from products into cursor crsProducts"
  ControlSource = "Orditems.Product_id"
  Style = 2
 
  Procedure KeyPress
    Lparameters nKeyCode, nShiftAltCtrl
    If nKeyCode = 24 And !Eof()
      Nodefault
      Skip
    Endif
    If nKeyCode = 5 And !Bof()
      Nodefault
      Skip -1
    Endif
  Endproc
Enddefine

7

Re: Grid içinde ENTER

Burada sen 13'u eklersin

8

Re: Grid içinde ENTER

Define Class myCombo As ComboBox
icin ufak bir duzeltme

Visual Fox Pro
RowSource = "select prod_name,eng_name,product_id"+;

        " from _samples+'Data\products' into cursor crsProducts"

9

Re: Grid içinde ENTER

farklı ama içime sinmeyen bir yöntemle çözmüş gibiydim fakat Çetin Abi senin yöntem tam oturdu ve hiç hata vermiyor.

Bu "nodefault" mevcutta seçili nesnenin yapması gerekeni iptal edip sizin belirlediğiniz işlemi yapmasını sağlıyor anlaşılan ve bu komut bir sürü yerde işime yarayacak şimdide den tekrar çok teşekkür


bende
keyprese 13 ise o kolonun adını bir değişkene yazıp bir satır aşağı indirip tekrar değişkeninin setfocus olması şeklinde halletmiştim

10

Re: Grid içinde ENTER

Duzeltmeye duzeltme:)

Visual Fox Pro
RowSource = "select prod_name,eng_name,product_id"+;

        " from ('" +_samples+"Data\products') into cursor crsProducts"

11

Re: Grid içinde ENTER

Evet bu daha iyi oldu smile