1

Konu: gridde sıralama

Merhaba,
bir gridin header'ına  tıklandığında, tıklanan header/column a göre gridin içini sıralasın istiyorum.
fakat bunun için header ın click metoduna bindevent() kullanarak, form/init()'inde yazdırmak istiyorum. nasıl yapabilirim?

2

Re: gridde sıralama

Gridlerimde genel olarak kullandığım bir sıralama var. arrowdown.bmp ve arrowup.bmp isminde 2 minik resim dosyası kullandım. tüm header ların click metoduna koyabilirsin. genel birşey yapmak istersen grid i class olarak tanımlaman daha iyi olur.

Visual Fox Pro
lordertoset=ALLTRIM(this.Parent.controlsource)

IF AT(".",lordertoset)>0
    lordertoset=SUBSTR(lordertoset,AT(".",lordertoset)+1)
endif       
 
DO case
    CASE LEN(ALLTRIM(this.Picture))=0
        this.Picture="images\arrowdown.bmp"
        SET ORDER TO &lordertoset asce
        GO top
 
    case JUSTFNAME(this.picture)="arrowdown.bmp"
        this.Picture="images\arrowup.bmp"
        SET ORDER TO &lordertoset desc
        GO top
 
    case JUSTFNAME(this.picture)="arrowup.bmp"   
        this.Picture=""
        SET ORDER TO
        GO top
ENDCASE
FOR i=1 TO this.Parent.Parent.ColumnCount
    columnx="Column"+ALLTRIM(STR(i))
    IF columnx<>this.Parent.name
        this.Parent.Parent.&columnx..header1.picture=""
    endif   
NEXT i
this.parent.parent.refresh
this.Parent.setfocus
Adesso 2008 (Code Name : Phoenix)

3

Re: gridde sıralama

Kendin cevabı vermişsin ya işte:) Bindevent kullanabilirsin.

4

Re: gridde sıralama

chamoore yazdı:

Gridlerimde genel olarak kullandığım bir sıralama var. arrowdown.bmp ve arrowup.bmp isminde 2 minik resim dosyası kullandım. tüm header ların click metoduna koyabilirsin. genel birşey yapmak istersen grid i class olarak tanımlaman daha iyi olur.

&& grid header click code

Visual Fox Pro
lordertoset=ALLTRIM(this.Parent.controlsource)

IF AT(".",lordertoset)>0
    lordertoset=SUBSTR(lordertoset,AT(".",lordertoset)+1)
endif       
 
DO case
    CASE LEN(ALLTRIM(this.Picture))=0
        this.Picture="images\arrowdown.bmp"
        SET ORDER TO &lordertoset asce
        GO top
 
    case JUSTFNAME(this.picture)="arrowdown.bmp"
        this.Picture="images\arrowup.bmp"
        SET ORDER TO &lordertoset desc
        GO top
 
    case JUSTFNAME(this.picture)="arrowup.bmp"   
        this.Picture=""
        SET ORDER TO
        GO top
ENDCASE
FOR i=1 TO this.Parent.Parent.ColumnCount
    columnx="Column"+ALLTRIM(STR(i))
    IF columnx<>this.Parent.name
        this.Parent.Parent.&columnx..header1.picture=""
    endif   
NEXT i
this.parent.parent.refresh
this.Parent.setfocus


calisan bir kod ornegi koysan sanirim arkadaslar daha rahat anlayabilirdi olayı
yeni baslayan arkadaslar kodun nereye ait oldugunu anlayamamis olabilirler