xBrowse refresh problem
Posted: Sun Mar 04, 2018 7:16 pm
Hi all, I have this code:
Use VENDA INDEX VENDA Shared New alias "VENDA" via "DBFCDX"
Database oVenda
...
oBrwPed := TXBrowse():New( oDlgPed )
oBrwPed:nMarqueeStyle := MARQSTYLE_HIGHLROW
oBrwPed:CreateFromResource( 109 )
oBrwPed:nColDividerStyle := 5 //LINESTYLE_BLACK // COLUNAS
oBrwPed:lColDividerComplete := .T.
oBrwPed:nHeaderHeight :=30
oBrwPed:nStretchCol := STRETCHCOL_LAST
oBrwPed:cAlias := "VENDA"
oCol := oBrwPed:AddCol()
oCol:bStrData := { || VENDA->NUMERO }
oCol:cHeader := "PEDIDO"
oCol := oBrwPed:AddCol()
oCol:bStrData := { || DTOC(VENDA->DATA)}
oCol:cHeader := "DATA"
oCol := oBrwPed:AddCol()
oCol:bStrData := { || VENDA->HORA }
oCol:cHeader := "HORA"
oCol := oBrwPed:AddCol()
oCol:bStrData := { || VENDA->CNPJCPF }
oCol:cHeader := "CNPJ/CPF"
oCol := oBrwPed:AddCol()
oCol:bStrData := { || SUBSTR(VENDA->CLIENTE,1,35) }
oCol:cHeader := "NOME CLIENTE"
oCol := oBrwPed:AddCol()
oCol:bStrData := { || Tran(VENDA->VALOR,"@E 9,999,999.99") }
oCol:cHeader := "BRUTO"
oCol:nDataStrAlign := AL_RIGHT
oCol := oBrwPed:AddCol()
oCol:bStrData := { || Tran(VENDA->DESCONTO,"@E 9,999,999.99") }
oCol:cHeader := "DESCONTO"
oCol:nDataStrAlign := AL_RIGHT
oCol := oBrwPed:AddCol()
oCol:bStrData := { || Tran(VENDA->LIQUIDO,"@E 9,999,999.99") }
oCol:cHeader := "LIQUIDO"
oCol:nDataStrAlign := AL_RIGHT
oCol := oBrwPed:AddCol()
oCol:bStrData := { || VENDA->VP }
oCol:cHeader := "V/P"
oCol:nDataStrAlign := AL_CENTER
oCol:nHeadStrAlign := AL_CENTER
oCol := oBrwPed:AddCol()
oCol:bStrData := { || DTOC(VENDA->DTBAIXA)}
oCol:cHeader := "DT BAIXA"
oBrwPed:SetoDbf(oVenda)
I some point i need to delete one record and I use:
oVenda:Delete()
oBrwPed:Refresh()
In File the record is deleted but the xbrowse still display the record, if i close and open again xbrowse are empty.
How I can refresh the xbrowser properly after delete record?
Thanks in advance.
Use VENDA INDEX VENDA Shared New alias "VENDA" via "DBFCDX"
Database oVenda
...
oBrwPed := TXBrowse():New( oDlgPed )
oBrwPed:nMarqueeStyle := MARQSTYLE_HIGHLROW
oBrwPed:CreateFromResource( 109 )
oBrwPed:nColDividerStyle := 5 //LINESTYLE_BLACK // COLUNAS
oBrwPed:lColDividerComplete := .T.
oBrwPed:nHeaderHeight :=30
oBrwPed:nStretchCol := STRETCHCOL_LAST
oBrwPed:cAlias := "VENDA"
oCol := oBrwPed:AddCol()
oCol:bStrData := { || VENDA->NUMERO }
oCol:cHeader := "PEDIDO"
oCol := oBrwPed:AddCol()
oCol:bStrData := { || DTOC(VENDA->DATA)}
oCol:cHeader := "DATA"
oCol := oBrwPed:AddCol()
oCol:bStrData := { || VENDA->HORA }
oCol:cHeader := "HORA"
oCol := oBrwPed:AddCol()
oCol:bStrData := { || VENDA->CNPJCPF }
oCol:cHeader := "CNPJ/CPF"
oCol := oBrwPed:AddCol()
oCol:bStrData := { || SUBSTR(VENDA->CLIENTE,1,35) }
oCol:cHeader := "NOME CLIENTE"
oCol := oBrwPed:AddCol()
oCol:bStrData := { || Tran(VENDA->VALOR,"@E 9,999,999.99") }
oCol:cHeader := "BRUTO"
oCol:nDataStrAlign := AL_RIGHT
oCol := oBrwPed:AddCol()
oCol:bStrData := { || Tran(VENDA->DESCONTO,"@E 9,999,999.99") }
oCol:cHeader := "DESCONTO"
oCol:nDataStrAlign := AL_RIGHT
oCol := oBrwPed:AddCol()
oCol:bStrData := { || Tran(VENDA->LIQUIDO,"@E 9,999,999.99") }
oCol:cHeader := "LIQUIDO"
oCol:nDataStrAlign := AL_RIGHT
oCol := oBrwPed:AddCol()
oCol:bStrData := { || VENDA->VP }
oCol:cHeader := "V/P"
oCol:nDataStrAlign := AL_CENTER
oCol:nHeadStrAlign := AL_CENTER
oCol := oBrwPed:AddCol()
oCol:bStrData := { || DTOC(VENDA->DTBAIXA)}
oCol:cHeader := "DT BAIXA"
oBrwPed:SetoDbf(oVenda)
I some point i need to delete one record and I use:
oVenda:Delete()
oBrwPed:Refresh()
In File the record is deleted but the xbrowse still display the record, if i close and open again xbrowse are empty.
How I can refresh the xbrowser properly after delete record?
Thanks in advance.