xbrowse edit columns
- Silvio.Falconi
- Posts: 4956
- Joined: Thu Oct 18, 2012 7:17 pm
xbrowse edit columns
Can not edit a column of a one row of xbrowse ?
I explain you
I have this xbrowse
I wish edit only for the first row only the columns I draw on green box
it's possible ?
I explain you
I have this xbrowse
I wish edit only for the first row only the columns I draw on green box
it's possible ?
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: xbrowse edit columns
See oCol:nEditType := any value > 0 like EDIT_GET, EDIT_BUTTON, etc for the columns you want to edit.
Retain oCol:nEditType := 0 for other columns.
What else am I missing?
Retain oCol:nEditType := 0 for other columns.
What else am I missing?
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- Silvio.Falconi
- Posts: 4956
- Joined: Thu Oct 18, 2012 7:17 pm
Re: xbrowse edit columns
Sorry perhaps I not explain good
Look the picture please
for the first record I wish edit only the columns 8 and 9 ( dates) and this record must not deleted
from second record to all records I wish edit only the column 4 and 5 , 8 and 9 ( and can be deleted)
thanks
Look the picture please
for the first record I wish edit only the columns 8 and 9 ( dates) and this record must not deleted
from second record to all records I wish edit only the column 4 and 5 , 8 and 9 ( and can be deleted)
thanks
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: xbrowse edit columns
For columns 4,5,8 and 9, set nEditType := EDIT_GET or EDIT_BUTTON or etc.
For columns 8 and 9 also add
Deletion has to be handled in the program code.
For columns 8 and 9 also add
Code: Select all
oCol:bEditWhen := { || oBrw:BookMark == 1 }
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- Silvio.Falconi
- Posts: 4956
- Joined: Thu Oct 18, 2012 7:17 pm
Re: xbrowse edit columns
WITH OBJECT oBrw:aCols[ 5]
:AddBmpFile(".\bitmaps\sh_plus.bmp")
:nBtnBmp := 1
:nwidth := 60
:nDataStrAlign := AL_CENTER
:nHeadStrAlign := AL_CENTER
:nEditType := EDIT_BUTTON
:bEditBlock := { ||RES->QUANTITY++ }
:lBtnTransparent := .t.
:bEditWhen := { || oBrw:BookMark == 1 }
END
not run it add the quantity also the record number 1
I think ed something of
:bEditWhen := { ||oBrw:aArrayData:nat<>1 }
where 1 is the first record
If you see the picture I wish the final user can edit only date for the first line of xbrowse
I wish also the final user cannot delete the first line
:AddBmpFile(".\bitmaps\sh_plus.bmp")
:nBtnBmp := 1
:nwidth := 60
:nDataStrAlign := AL_CENTER
:nHeadStrAlign := AL_CENTER
:nEditType := EDIT_BUTTON
:bEditBlock := { ||RES->QUANTITY++ }
:lBtnTransparent := .t.
:bEditWhen := { || oBrw:BookMark == 1 }
END
not run it add the quantity also the record number 1
I think ed something of
:bEditWhen := { ||oBrw:aArrayData:nat<>1 }
where 1 is the first record
If you see the picture I wish the final user can edit only date for the first line of xbrowse
I wish also the final user cannot delete the first line
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
- Silvio.Falconi
- Posts: 4956
- Joined: Thu Oct 18, 2012 7:17 pm
Re: xbrowse edit columns
I tried also with
:nEditType := EDIT_BUTTON
:bEditBlock := { |o|Msginfo("") }
:bEditWhen := { || oBrw:nArrayAt<>1 }
I wish when on first line of the browse thefinal user cannot edit the cell
the user can edit only from second line
:nEditType := EDIT_BUTTON
:bEditBlock := { |o|Msginfo("") }
:bEditWhen := { || oBrw:nArrayAt<>1 }
I wish when on first line of the browse thefinal user cannot edit the cell
the user can edit only from second line
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: xbrowse edit columns
Please try
:bEditWhen := { || oBrw:KeyNo == 1 }
:bEditWhen := { || oBrw:KeyNo == 1 }
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: xbrowse edit columns
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- Silvio.Falconi
- Posts: 4956
- Joined: Thu Oct 18, 2012 7:17 pm
Re: xbrowse edit columns
GOOD
RAO YOU'RE FANTASTIC
tha value must be on center!
Last edited by Silvio.Falconi on Mon May 14, 2018 10:26 am, edited 2 times in total.
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
- Silvio.Falconi
- Posts: 4956
- Joined: Thu Oct 18, 2012 7:17 pm
Re: xbrowse edit columns
Rao
:bEditWhen := { || oBrw:KeyNo == 1 }
I tried also with
:bEditWhen := { || oBrw:KeyNo <>1 }
it continue to process the editblock on first line
:bEditWhen := { || oBrw:KeyNo == 1 }
I tried also with
:bEditWhen := { || oBrw:KeyNo <>1 }
it continue to process the editblock on first line
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
- Silvio.Falconi
- Posts: 4956
- Joined: Thu Oct 18, 2012 7:17 pm
Re: xbrowse edit columns
Rao if you try this test
it modified the record inserting "modified"
I wish no modify the first record How I can resolve ?
beditwhen must make as this function
Function test(oBrw)
IF oBrw:keyno =1
Msginfo(" I cannot mofified")
else
return "modified"
endif
return nil
but it not run ok
Now I correct with
:bEditBlock := { ||IF(oBrw:KeyNo=1,,RES->QUANTITY++) }
but I cannot use bwhenedit codeblock
Code: Select all
#include "fivewin.ch"
function Main()
local oDlg, oBrw
USE c:\work\FWH\SAMPLES\CUSTOMER
DEFINE DIALOG oDlg SIZE 700,400 PIXEL TRUEPIXEL
@ 20,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg DATASOURCE Alias() ;
AUTOCOLS CELL LINES NOBORDER
WITH OBJECT oBrw:aCols[ 2 ]
:nEditType := EDIT_BUTTON
:AddResource( "OPEN" )
:nBtnBmp := 1
:bEditBlock := { || test()}
:beditwhen := { || oBrw:keyno <> 1 }
END
oBrw:CreateFromCode()
ACTIVATE DIALOG oDlg CENTERED
return nil
Function test()
return "modified"
I wish no modify the first record How I can resolve ?
beditwhen must make as this function
Function test(oBrw)
IF oBrw:keyno =1
Msginfo(" I cannot mofified")
else
return "modified"
endif
return nil
but it not run ok
Now I correct with
:bEditBlock := { ||IF(oBrw:KeyNo=1,,RES->QUANTITY++) }
but I cannot use bwhenedit codeblock
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
- Silvio.Falconi
- Posts: 4956
- Joined: Thu Oct 18, 2012 7:17 pm
Re: xbrowse edit columns
Now with these lines seem run ok
is there a bug on bwhenedit codeblock ?
Code: Select all
WITH OBJECT oBrw:aCols[ 4]
:AddBmpFile(".\bitmaps\sh_minus.bmp")
:nBtnBmp := 1
:nwidth := 40
:nEditType := EDIT_BUTTON
:bEditBlock := { ||IF(oBrw:KeyNo=1,,IIF(RES->QUANTITY>1, RES->QUANTITY--,RES->QUANTITY:= 1)) }
:lBtnTransparent := .t.
:lBmpStretch := .t.
:nDataStrAlign := AL_CENTER
:nHeadStrAlign := AL_CENTER
END
WITH OBJECT oBrw:aCols[ 5]
:AddBmpFile(".\bitmaps\sh_plus.bmp")
:nBtnBmp := 1
:nwidth := 60
:nDataStrAlign := AL_CENTER
:nHeadStrAlign := AL_CENTER
:nEditType := EDIT_BUTTON
:bEditBlock := { ||IF(oBrw:KeyNo=1,,RES->QUANTITY++) }
:lBtnTransparent := .t.
END
is there a bug on bwhenedit codeblock ?
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: xbrowse edit columns
You are right.is there a bug on bwhenedit codeblock ?
bEditWhen is not preventing button action of EDIT_BUTTON.
This is now fixed in 18.04.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- Silvio.Falconi
- Posts: 4956
- Joined: Thu Oct 18, 2012 7:17 pm
Re: xbrowse edit columns
thanks
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
-
- Posts: 41
- Joined: Thu Sep 17, 2015 11:40 pm
Re: xbrowse edit columns
Saludos estoy necesitando poner un button en el xbrowse que me lleve a una consulta de movimientos del documento seleccionado todo funciona bien le he puesto una imagen al button pero cuando abandono la aplicación se me cuelga comento ese configuracion de la columna y termina normal.
/*
WITH OBJECT aBrw:aCols[ 1 ]
:addbmpfile( op:bmp16+"eye.bmp" )
:nBtnBmp := 1
:nEditType := EDIT_BUTTON
:bEditBlock := {|| VerItems( cCodigo,cQry:tipo,cQry:ord_comp )}
:lBtnTransparent := .t.
:lBmpStretch := .t.
END
*/
he tenido que solucionarlo usando
:aCols[01]:bLDClickData := { || VerItems( cCodigo,cQry:tipo,cQry:ord_comp ) }
version de FWH 1801 hay alguna razon ??
/*
WITH OBJECT aBrw:aCols[ 1 ]
:addbmpfile( op:bmp16+"eye.bmp" )
:nBtnBmp := 1
:nEditType := EDIT_BUTTON
:bEditBlock := {|| VerItems( cCodigo,cQry:tipo,cQry:ord_comp )}
:lBtnTransparent := .t.
:lBmpStretch := .t.
END
*/
he tenido que solucionarlo usando
:aCols[01]:bLDClickData := { || VerItems( cCodigo,cQry:tipo,cQry:ord_comp ) }
version de FWH 1801 hay alguna razon ??