1

Konu: Kolon formatı

Gridde nümerik bir kolonum var bu kolonda virgülden sonra 5 basamak decimal kısmı olan rakamlar da var, tamsayı olanlar da var. Aynı kolonda gözüken bu sayılardan örneğin 12 rakamının 12,00000 şeklinde gözükmemesini, virgülden sonra ne kadar az basamak var ise o kadar gözükmesini nasıl sağlayabilirim, kolon formatını nasıl tanımlamalıyım ?
Teşekkürler.

2

Re: Kolon formatı

ben gridde numerik kolonlarımı aşağıdaki gibi düzenliyorum.

Visual Fox Pro
.column6.inputmask = "999,999,999.99999"
Kader, beyaz kağıda sütle yazılmış yazı
Elindeyse beyazdan, gel de sıyır beyazı. (NFK)

3

Re: Kolon formatı

Aklima birsey geliyor ama edit izni vereceksen cok da kolay degil:

Izin vermeyeceksen sadece okunacak ise:

Visual Fox Pro
set decimals to 5

 
columnX.Controlsource = "( alltrim(transform(dosya.alan), 1, ' ', '0', '$', '.')  )"
columnX.alignment = 1


Izin vereceksen:

Visual Fox Pro
Public oForm

oForm = Createobject('myForm')
oForm.Show()
 
Define Class myForm As Form
    Height=200
    Width=200
    DataSession = 2
 
    Add Object myGrid As Grid With RecordSource = 'dosya', ColumnCount=2, Height=200, Width=200,Anchor=15
 
    Procedure Load
        Create Cursor dosya (Alan b(5))
        Insert Into dosya Values (12)
        Insert Into dosya Values (12.1)
        Insert Into dosya Values (12.12)
        Insert Into dosya Values (12.123)
        Insert Into dosya Values (12.1234)
        Insert Into dosya Values (12.12345)
        Locate
 
        Set Decimals To 5
    Endproc
 
    Procedure myGrid.Init
        With This.Columns(1)
            .Alignment = 1
            .ControlSource = "( alltrim(transform(dosya.alan), 1, ' ', '0', '$', '.')  )"
            .Newobject('myContainer', 'myContainer','','','dosya.alan')
            .myContainer.Visible  = .T.
            .CurrentControl = 'myContainer'
        Endwith
 
        With This.Columns(2)
            .Alignment = 1
            .ControlSource = "dosya.alan"
        Endwith
    Endproc
 
Enddefine
 
Define Class myContainer As Container
    Anchor = 15
    Height = 20
    Width = 75
    ControlSource = ''
 
    Add Object myText As TextBox With BorderStyle=0, Margin=0, Anchor=15,  Height = 20, Width = 75, SelectOnEntry=.T., Format='K'
 
    Procedure myText.GotFocus
        This.SelStart = 0
        Keyboard '{shift+end}'
    Endproc
    Procedure myText.KeyPress(nKey, nShift)
        If m.nKey = 5
            Nodefault
            If !Bof()
                Skip -1
            Endif
        Endif
        If m.nKey = 24
            Nodefault
            If !Eof()
                Skip 1
            Endif
        Endif
    Endproc
 
    Procedure Init(tcSource)
        This.ControlSource = m.tcSource
        This.myText.ControlSource = m.tcSource
    Endproc
Enddefine

4

Re: Kolon formatı

Edit ettirmeyecektim hocam, çok teşekkürler, test edeceğim.