1

Konu: GRID TAZELEME

1-Git1 = "0"        Program başında "Git1" değişkenine "0" değeri atıyorum.
2- GRID de

             IF git1="0"
                musf1="ucret.mf0"
                musf2="ucret.md0"
             ELSE
                musf1="ucret.mf"+VAL(git1)
                musf2="ucret.md"+VAL(git1)
             ENDIF   

            .Column5.Header1.Caption = 'İşem Fiyatı'
            .Column5.Width = 90       
            .Column5.ControlSource = "&musf1"

            .Column6.Header1.Caption = 'Döviz'
            .Column6.Width = 50       
            .Column6.ControlSource = "&musf2"

    6. ve 7. kolunda "0" değerini gösteriyorum.

3- "Procedure PPEdit " te "Git1" e yeni bir değer atadım ve "GRID" i tazeledim.

       git1=.FatFirma1.value

        .grdListe.Refresh()
        .grdListe.SetFocus()

4- Amacım yeni atanan değere göre "ELSE den sonraki kısım" GRID te göstermek. Ama GRIDI tazelediğim halde olmadı .Sorun nerede olabilir ?

             IF git1="0"
                musf1="ucret.mf0"
                musf2="ucret.md0"
             ELSE
                musf1="ucret.mf"+VAL(git1)
                musf2="ucret.md"+VAL(git1)
             ENDIF   

            .Column5.Header1.Caption = 'İşem Fiyatı'
            .Column5.Width = 90       
            .Column5.ControlSource = "&musf1"

            .Column6.Header1.Caption = 'Döviz'
            .Column6.Width = 50       
            .Column6.ControlSource = "&musf2"


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  ADD OBJECT FatFirma1 AS combobox WITH ;
      Top = 2, ;
      left = 330, ;
      Width = 150, ;   
      BackColor = 65535, ;
      rowsourcetype=2,;
      rowsource="Musteri.adi,no",;
      boundcolumn=2,;
      columncount=2,;
      columnwidths="250,60,0",;
      Enabled = .T.

******************************************************************
Procedure ppEdit
******************************************************************
    With oForm


        git1=.FatFirma1.value

        .grdListe.Refresh()
        .grdListe.SetFocus()

    EndWith
EndProc

******************************************************************
Define Class myGrid as Grid
******************************************************************
*    Top = 62
    Top = 140
    Left = 2
    Height = 400
    Width = 1045
    ColumnCount = 6
    DeleteMark = .F.
    RecordMark = .t.
    ReadOnly = .T.
    RecordSource = "ucret"
    ScrollBars = 3
    GridLineColor = Rgb(192,192,192)
   
    Procedure Init
        With this
*       Scatter Name This.oRecord Memo

            .Column1.Header1.Caption = 'Sıra'
            .Column1.Width = 30       
            .Column1.ControlSource = "ucret.no"

            .Column2.Header1.Caption = 'İşlem Adı'
            .Column2.Width = 230       
            .Column2.ControlSource = "ucret.adi"

            .Column3.Header1.Caption = 'İşem Fiyatı'
            .Column3.Width = 90       
            .Column3.ControlSource = "ucret.fiyat"

            .Column4.Header1.Caption = 'Döviz'
            .Column4.Width = 50       
            .Column4.ControlSource = "ucret.doviz"

             IF git1="0"
                musf1="ucret.mf0"
                musf2="ucret.md0"
             ELSE
                musf1="ucret.mf"+VAL(git1)
                musf2="ucret.md"+VAL(git1)
             ENDIF   

            .Column5.Header1.Caption = 'İşem Fiyatı'
            .Column5.Width = 90       
            .Column5.ControlSource = "&musf1"

            .Column6.Header1.Caption = 'Döviz'
            .Column6.Width = 50       
            .Column6.ControlSource = "&musf2"


        EndWith
    this.SetAll('Enabled',.f.,'textbox')
    this.SetAll('DisabledForeColor',0,'textbox')

    EndProc
   
    Procedure AfterRowColChange
        Lparameters nColIndex
        DoDefault(nColIndex)
        With oForm

            .txtadi.Value     = Adi
               .txtfiyat.Value    = Fiyat
               .txtdoviz.Value    = Doviz

        EndWith
       Thisform.Refresh()
    EndProc
EndDefine

2

Re: GRID TAZELEME

Onder,
Buradan sonrasina bakmadim bile:

Visual Fox Pro
IF git1="0" 

                musf1="ucret.mf0"
                musf2="ucret.md0"
             ELSE
                musf1="ucret.mf"+VAL(git1)
                musf2="ucret.md"+VAL(git1)
             ENDIF


Karakter + numerik yapmissin. Bu diger dillerin birsogunda mumkun ama VFP'de degil, +'nin o sekilde overload' yok.

Visual Fox Pro
musf1="ucret.mf"+ltrim(str(int(VAL(m.git1)))) 

                musf2="ucret.md"+ltrim(str(int(VAL(m.git1))))

ya da:

Visual Fox Pro
musf1=textmerge("ucret.mf<< m.git1 >>") 

                musf2=textmerge("ucret.md<< m.git1 >>")

git1 gibi public degiskenler basina sorun cikarabilir. Onun yerine form'a bir property ekle onu kullan bence.

3

Re: GRID TAZELEME

Onder,
Buradan sonrasina bakmadim bile:

Visual Fox Pro
IF git1="0" 

                musf1="ucret.mf0"
                musf2="ucret.md0"
             ELSE
                musf1="ucret.mf"+VAL(git1)
                musf2="ucret.md"+VAL(git1)
             ENDIF


Karakter + numerik yapmissin. Bu diger dillerin birsogunda mumkun ama VFP'de degil, +'nin o sekilde overload' yok.

Visual Fox Pro
musf1="ucret.mf"+ltrim(str(int(VAL(m.git1)))) 

                musf2="ucret.md"+ltrim(str(int(VAL(m.git1))))

ya da:

Visual Fox Pro
musf1=textmerge("ucret.mf<< m.git1 >>") 

                musf2=textmerge("ucret.md<< m.git1 >>")

git1 gibi public degiskenler basina sorun cikarabilir. Onun yerine form'a bir property ekle onu kullan bence.

4

Re: GRID TAZELEME

Çetin,

Haklısın
musf1="ucret.mf"+VAL(git1)
yazarak saçmalamışım.

Ama sormak istediğim şu.

** Program başladığında 1 kez GRID e gidiyor ve

             IF git1="0"
                musf1="ucret.mf0"
                musf2="ucret.md0"
             ELSE
                musf1="ucret.mf"+ALLTRIM(git1)
                musf2="ucret.md"+ALLTRIM(git1)
             ENDIF   

            .Column5.Header1.Caption = 'İşem Fiyatı'
            .Column5.Width = 90       
            .Column5.ControlSource = "&musf1"

            .Column6.Header1.Caption = 'Döviz'
            .Column6.Width = 50       
            .Column6.ControlSource = "&musf2"

kodları çalıştıyor.

Fakat Butona basıp "Procedure ppEdit "

i çalıştırdığımızda

        .grdListe.Refresh()
        .grdListe.SetFocus()

komutlarına rağmen GRID e gitmiyor.

nedeni ne olabilir ?

5 Son düzenleyen, konuka (24.11.2011 14:26:25)

Re: GRID TAZELEME

Çetin gelmeden smile
Form1.Grid1.Column1.Text1.SetFocus olacak

belki şu çalışırsa daha akademik olur:
m.xkolon=1
m.gidilecek="Form1.Grid1.Columns[m.xkolon]."+Form1.Grid1.Columns[m.xkolon].CurrentControl+".setfocus"
&gidilecek

VFP9 SP2

6

Re: GRID TAZELEME

Add Object grdListe as myGrid


bendeki ornege göre yazılımı nasıl olmalı ve

Procedure ppEdit
te kullanmamız gerekiyor . Değil mi ?

oForm.grdListe.Column5.Header1.SetFocus

DENEDİM OLMADI ?

7

Re: GRID TAZELEME

Abi geldim, kacayim mi:)

Visual Fox Pro
.grdListe.Setfocus

yeterli. Icinde ozel olarak bir yere gidilecekse:

Visual Fox Pro
m.xkolon=1 

thisform.grdListe.Columns[m.xkolon].setfocus()
* veya
thisform.grdListe.Columns[m.xkolon].CurrentControl.setfocus()

Ben soruyu tam anlayamamakla birlikte bu duzeltmeleri yapma egilimindeyim:)

Visual Fox Pro
* gereksiz bir if bloku

* IF git1="0"
*                musf1="ucret.mf0"
*               musf2="ucret.md0"
  *           ELSE
   *             musf1
    *            musf2="ucret.md"+ALLTRIM(git1)
     *        ENDIF   
 
            .Column5.Header1.Caption = 'İşem Fiyatı'
            .Column5.Width = 90       
            .Column5.ControlSource = "ucret.mf"+ALLTRIM(m.git1)
 
            .Column6.Header1.Caption = 'Döviz'
            .Column6.Width = 50       
            .Column6.ControlSource ="ucret.md"+ALLTRIM(m.git1)

Ikincisi:
Grid initde:

Visual Fox Pro
this.SetAll('Enabled',.f.,'textbox') 

    this.SetAll('DisabledForeColor',0,'textbox')

varken SetFocus() neyin nesi? Diasble etmissin zaten.

8 Son düzenleyen, onders (24.11.2011 15:37:09)

Re: GRID TAZELEME

GRID i aşağıdakki şekilde düzelttim.

            .Column5.Header1.Caption = 'İşem Fiyatı'
            .Column5.Width = 90       
            .Column5.ControlSource = "ucret.mf"+ALLTRIM(m.git1)

            .Column6.Header1.Caption = 'Döviz'
            .Column6.Width = 50       
            .Column6.ControlSource = "ucret.md"+ALLTRIM(m.git1)

"Procedure ppEdit " i aşağıdaki şekilde düzelttim. Sorun çözüldü. Teşekkürler....

        m.git1=.FatFirma1.value

        .grdListe.Column5.ControlSource = "ucret.mf"+ALLTRIM(m.git1)
        .grdListe.Column6.ControlSource = "ucret.md"+ALLTRIM(m.git1)