1

Konu: hangi komutla GRID i tazeleyebilirim

Aşagıdaki kodda

YENİ KAYIT tuşuna basıp kaydı girdikten sonra SAKLA tuşunu kullanıyorum.
Ama grid e dokunmadan GRID  deki bilgiler tazelenmiyor.

Tazeleme komutu nedir ?

Teşekkürler.

***********************************************************************

Visual Fox Pro
1

2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
Clear All

 
Public oForm
oForm = Createobject("bayrak")
oForm.Show(1)
 
Define Class bayrak As Form
  DataSession = 2
  Top    = 2
  Left   = 50
  Height = 390  
  Width  = 350
  Name   = "bayrak"
  Caption = "Bayrak Kodu"
 
  orecord = .Null.
 
  Add Object lblno As Label With ;
    left = 5, Top = 5, Width = 45, Caption = "Kodu :"
 
  Add Object lbladi As Label With ;
    left = 5, Top = 30, AutoSize=.T., Caption = "Adı     :"
 
  Add Object txtNo As myTextBox With ;
    left = 45, Top = 2, Width = 35, ControlSource = "bayrak.no",Enabled = .F.,SelectOnEntry = .T.
 
  Add Object txtAdi As myTextBox With ;
    left = 45, Top = 27, Width = 150, ControlSource = "bayrak.adi",Enabled = .F.
 
   Add Object cmdNew as CommandButton With ;
        Top = 2, ;
        Left = 250, ;
        Height = 27, ;
        Width = 84, ;
        Caption = 'Yeni Kayıt', ;
        Enabled = .t.
 
    Add Object cmdSave as CommandButton With ;
        Top = 2, ;
        Left = 250, ;
        Height = 27, ;
        Width = 84, ;
        Caption = 'Sakla', ;
        Visible = .f.
 
    Add Object cmdEdit as CommandButton With ;
        Top = 32, ;
        Left = 250, ;
        Height = 27, ;
        Width = 84, ;
        Caption = 'Düzelt', ;
        Enabled = .t.
 
    Add Object cmdUpdate as CommandButton With ;
        Top = 32, ;
        Left = 250, ;
        Height = 27, ;
        Width = 84, ;
        Caption = 'Sakla', ;
        Visible = .f.
 
    Add Object cmdDelete as CommandButton With ;
        Top = 62, ;
        Left = 250, ;
        Height = 27, ;
        Width = 84, ;
        Caption = 'Sil', ;
        Enabled = .t.
 
    Add Object cmdClose as CommandButton With ;
        Top = 92, ;
        Left = 250, ;
        Height = 27, ;
        Width = 84, ;
        Caption = 'Kapat'
 
    Add Object grdListe as myGrid
 
 
    Procedure cmdNew.Click
        ppNew()
    EndProc
 
    Procedure cmdSave.Click
        ppSave()
    EndProc
   
 
    Procedure cmdClose.Click
        CLOSE ALL  
        thisform.Release
    EndProc
     
*  Add Object grdOrders As Grid With ;
*    Left = 10, Top = 90, Height = 400, Width = 780, ;
*    RecordSource = "Orders", ;
*    LinkMaster = "Customer", ;
*    ChildOrder = "cust_id",;
*    RelationalExpr = "cust_id"
 
  Procedure Load
    Use bayrak INDEX bayrak1,bayrak2
*    In 0
*    Use (_samples+"data\orders") In 0
 
*    cursorsetprop("buffering",5,"customer")
*    cursorsetprop("buffering",5,"orders")
  Endproc
 
Enddefine
******************************************************************
Define Class myTextBox as TextBox
******************************************************************
    Enabled = .f.
    DisabledForeColor = Rgb(0,0,0)
    SelectOnEntry = .t.
EndDefine
 
******************************************************************
Procedure ppNew
******************************************************************
    With oForm
        APPEND BLANK
        .txtNo.Enabled = .t.
        .txtNo.Value = 0
        .txtAdi.Enabled = .t.
        .txtAdi.Value = ''
 
        .cmdNew.Visible = .f.
        .cmdSave.Visible = .t.
        .cmdEdit.Visible = .f.
        .cmdDelete.Visible = .f.
                       
*        .grdListe.Enabled = .f.
        .txtNo.SetFocus()
    EndWith
EndProc
 
******************************************************************
Procedure ppSave
******************************************************************
    With oForm
        If .txtNo.Value > 0
           REPLA no  WITH .txtNo.Value  
           REPLA adi WITH .txtAdi.Value  
 
*           Thisform.Refresh()
           MessageBox('Kayıt işlemi'+Chr(13)+'başarıyla tamamlandı')
        EndIf
 
        .txtNo.Enabled = .f.
        .txtAdi.Enabled = .f.
        .cmdNew.Visible = .t.
        .cmdSave.Visible = .f.
        .cmdEdit.Visible = .t.
        .cmdDelete.Visible = .t.
*        .cmdListe.Click()
*        .grdListe.Enabled = .t.
*        .grdListe.SetFocus()
 
 
    EndWith
EndProc
 
******************************************************************
Define Class myGrid as Grid
******************************************************************
    Top = 62
    Left = 2
    Height = 310
    Width = 220
    ColumnCount = 2
    DeleteMark = .t.
    RecordMark = .t.
    ReadOnly = .T.
    RecordSource = "bayrak"
    ScrollBars = 2
    GridLineColor = Rgb(192,192,192)
   
    Procedure Init
        With this
*       Scatter Name This.oRecord Memo
 
            .Column1.Header1.Caption = 'Kodu'
            .Column1.Width = 50        
            .Column2.Header1.Caption = 'Adı'
            .Column2.Width = 150        
*            .Column3.Header1.Caption = 'Yaşı'
*            .Column4.Header1.Caption = 'Maaşı'
*            .Column4.Width = 100        
        EndWith
    this.SetAll('Enabled',.f.,'textbox')
    this.SetAll('DisabledForeColor',0,'textbox')
 
    EndProc
   
    Procedure AfterRowColChange
        Lparameters nColIndex
        DoDefault(nColIndex)
        With oForm
            .txtno.Value = No
            .txtadi.Value = Adi
*            .txtYas.Value = Yas
*            .txtMaas.Value = Maas
        EndWith
       Thisform.Refresh()
    EndProc
EndDefine

2

Re: hangi komutla GRID i tazeleyebilirim

Visual Fox Pro
1

2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Procedure ppSave

******************************************************************
    With oForm
        If .txtNo.Value > 0
           REPLA no  WITH .txtNo.Value  
           REPLA adi WITH .txtAdi.Value  
           MessageBox('Kayıt işlemi'+Chr(13)+'başarıyla tamamlandı')
        .txtNo.Enabled = .f.
        .txtAdi.Enabled = .f.
        .cmdNew.Visible = .t.
        .cmdSave.Visible = .f.
        .cmdEdit.Visible = .t.
        .cmdDelete.Visible = .t.
        .grdListe.Refresh()
        .grdListe.SetFocus()
        EndIf
     EndWith
EndProc
http://www.soykansoft.com/images/twitter.jpghttp://www.soykansoft.com/images/wp.jpghttp://www.soykansoft.com/images/blogger.jpg

3

Re: hangi komutla GRID i tazeleyebilirim

SAKLA butonu click event ine;

Thisform.MyGrid.Refresh

4

Re: hangi komutla GRID i tazeleyebilirim

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

eklemesini yaptım. Güncellemeleri yapıyor. (GRID tazaleniyor. Ama

1 raplacements
1 raplacements

yazıları formu bozacak şekilde ekrana çıkıyor ?

en üste
SET TALK OFF

komutunu koymama rağmen

1 raplacements
1 raplacements

yazılar gelmeye devam ediyor.

nasıl yok edebilirim ?

5

Re: hangi komutla GRID i tazeleyebilirim

SET NOTIFY OFF