El post que buscas se encuentra eliminado, pero este también te puede interesar

Programación en Foxpro 9 - Como Usar una Grilla

Bueno. Aquí les traigo un códgio sencillo de como ulilizar la grilla de fox muy util a la hora de mostrar datos


**

**
p = Alltrim(Thisform.text1.Value)
Select arthabili,ArtCodigo,Artbarra,ArtDescrip,artpreba,artpremay,artpremos,marca.Mardescrip,artfila,artestante,artbandeja,artdivi From articulo,grupo,marca Where articulo.MarCodigo = marca.MarCodigo And articulo.grucodigo = grupo.grucodigo Into Cursor CUR_ART

Select * From CUR_ART Where Like('*'+Alltrim(Lower(p))+'*',Alltrim(Lower(ArtDescrip)))Or Alltrim(Str(Artbarra)) = Alltrim((p)) Or Alltrim((ArtCodigo)) = Alltrim((p)) Into Cursor CUR_ART Readwrite

* para ordenar
If This.orDENAR.Value = 1
Select * From CUR_ART Order By ArtCodigo Into Cursor CUR_ART Readwrite
Endif

If This.orDENAR.Value = 2
Select * From CUR_ART Order By ArtDescrip Into Cursor CUR_ART Readwrite
Endif

If This.orDENAR.Value = 3
Select * From CUR_ART Order By artpremos Into Cursor CUR_ART Readwrite
Endif
* Fin



If Thisform.check1.Value = 1
Select * From CUR_ART,stock Where Alltrim(CUR_ART.ArtCodigo)==Alltrim(stock.ArtCodigo) Into Cursor CUR_ART
Endif


***-------------------------------Para modificar ...................................
Thisform.list1.RecordSource ="cur_art" && Tabla

Thisform.list1.ColumnCount = 8 && Cantidad de columna



***------------------no tocar---------------------------------------------------****
Thisform.list1.AllowCellSelection = .F. && Para seleccionar todo
Thisform.list1.GridLines = 3 && Linea deshabilitada
Thisform.list1.DeleteMark = .F. && Marca p/ borrar deshabilitada
Thisform.list1.FontName = "Tahoma" && Tipo de letra
Thisform.list1.RowHeight = 20 && Tamaño entre registro
Thisform.list1.AllowHeaderSizing = .T. && Tamaño de la cabecera
Thisform.list1.GridLineColor = _COLOR
Thisform.list1.FontSize = 8

***Detalle de la Columna 1
Thisform.list1.Column1.Width = 15
Thisform.list1.Column1.header1.Caption = ""
Thisform.list1.Column1.AddObject("im", "image"
Thisform.list1.Column1.CurrentControl = "im"
Thisform.list1.Column1.im.Visible = .T.
Thisform.list1.Column1.im.Picture = "Hacer.bmp"
*Thisform.list1.Column1.im.BorderStyle= .T.
Thisform.list1.Column1.Sparse = .F.
***-----------------------------------------------------------------------------****




***----------------PARA LAS COLUMNA DE LA GRILLA................................****
Thisform.list1.Column2.Width = 1
Thisform.list1.Column2.header1.Caption = ""
Thisform.list1.Column2.ControlSource ="arthabili"
Thisform.list1.Column2.AddObject("ex", "checkbox"
Thisform.list1.Column2.CurrentControl = "ex"
Thisform.list1.Column2.ex.Visible = .F.
Thisform.list1.Column2.ex.Caption = ""
Thisform.list1.Column2.ex.BackStyle = 0
Thisform.list1.Column2.Sparse = .F.

Thisform.list1.Column3.Width = 50 && Tamaño
If Thisform.check1.Value = 1
Thisform.list1.Column3.ControlSource ="ArtCodigo_a" && Campo
Else
Thisform.list1.Column3.ControlSource ="ArtCodigo" && Campo
Endif
Thisform.list1.Column3.header1.Caption = "Código" && Título
Thisform.list1.Column3.header1.ForeColor = Rgb(0,0,128) && Color de la letra del título
*Thisform.list1.Column3.header1.FontBold = .T. && Título en negrita
Thisform.list1.Column3.header1.Alignment = 0 && Alineamiento del título
Thisform.list1.Column3.Alignment = 0

Thisform.list1.Column4.Width = 50
Thisform.list1.Column4.ControlSource ="Artbarra"
Thisform.list1.Column4.header1.Caption = "Cód/barra"
Thisform.list1.Column4.header1.ForeColor = Rgb(0,0,128)
*Thisform.list1.Column3.header1.FontBold = .T.
Thisform.list1.Column4.header1.Alignment = 0
Thisform.list1.Column4.Alignment = 0

Thisform.list1.Column5.Width = 350
Thisform.list1.Column5.ControlSource ="ArtDescrip"
Thisform.list1.Column5.header1.Caption = "Articulo*"
Thisform.list1.Column5.header1.ForeColor = Rgb(0,0,128)
*Thisform.list1.Column5.header1.FontBold = .T.
Thisform.list1.Column5.header1.Alignment = 0
Thisform.list1.Column5.Alignment = 0


Thisform.list1.Column6.Width = 80
Thisform.list1.Column6.ControlSource ="artpremos"
Thisform.list1.Column6.header1.Caption = "P. Venta"
Thisform.list1.Column6.header1.ForeColor = Rgb(0,0,128)
*Thisform.list1.Column6.header1.FontBold = .T.
Thisform.list1.Column6.header1.Alignment = 0
Thisform.list1.Column6.InputMask ="999,999,999"
Thisform.list1.Column6.Alignment = 1
Thisform.list1.Column6.ForeColor = Rgb(255,0,0)
Thisform.list1.Column6.FontBold = .T.


If Thisform.check1.Value = 1
Thisform.list1.Column7.Width = 80
Thisform.list1.Column7.ControlSource ="artexisten"
Thisform.list1.Column7.header1.Caption = "Stock Actual"
Thisform.list1.Column7.header1.ForeColor = Rgb(0,0,128)
Thisform.list1.Column7.FontSize = 10
*Thisform.list1.Column7.header1.FontBold = .T.
Thisform.list1.Column7.header1.Alignment = 0
Thisform.list1.Column7.InputMask ="999,999,999.999"
Thisform.list1.Column7.Alignment = 1
Thisform.list1.Column7.ForeColor = Rgb(255,0,0)
Thisform.list1.Column7.FontBold = .T.
Thisform.list1.Column8.header1.Caption = "Marcas"
ELSE
*Thisform.list1.Column7.Width = 1
Thisform.list1.Column8.Width = 80
Thisform.list1.Column8.ControlSource ="Mardescrip"
Thisform.list1.Column8.header1.Caption = "Marcas"
Thisform.list1.Column8.header1.ForeColor = Rgb(0,0,128)
Thisform.list1.Column8.header1.FontBold = .T.
Thisform.list1.Column8.header1.Alignment = 0

Endif

Thisform.list1.Refresh
* Para marcar los deshabilitados RGB(255,206,183)
*thisform.BackColor = RGB(255,234,213)
x = "1"
Thisform.list1.SetAll("DynamicBackColor","IIF(thisform.list1.Column2.ex.value=&x,RGB(255,234,213),IIF(MOD(RECNO( ),2)=0, RGB(255,255,255),_COLOR))","Column"


Thisform.list1.RowHeight = 25



Wait Clear

1 comentario - Programación en Foxpro 9 - Como Usar una Grilla