Column width in dynamic browser

rzr

Member
how do I modify the width of column of a dynamic browser?

Code:
CREATE BROWSE hBrowse
    ASSIGN WIDTH     = 80   
           DOWN      = 10
           QUERY     = hQuery
           FRAME     = FRAME X:HANDLE
           READ-ONLY = FALSE
           SENSITIVE = TRUE
           FONT      = 2.
hBrowse:ADD-LIKE-COLUMN("Customer.Name").

this will take a the default width of customer.name field {x(20) in my db}.
How do I increase the width of this column to X(40) ?
 
its not a gobal thing as far as i know... each coulmn (when you've got some will need the width setting)assign hbrCol = BRDetail:first-column in frame fmain. repeat:
 
its not a gobal thing as far as i know... each coulmn (when you've got some will need the width setting) unless there is att to set the default column size..


Code:
assign hbrCol = BRDetail:first-column in frame fmain. 
repeat:


hbrCol:width = intLength.
assign hbrCol = hbrCol:next-column.                         
        if not valid-handle(hbrCol) then                         
        leave.  


end.
 
okay, i should have been more specific. WIDTH / WIDTH-CHARS will increase the width of the column from X(20) to X(40), but the actual data shown within the column is still only 20 characters. It does not show all 40 characters of data.
It is because the format for customer.name is X(20) and I want to override this within the browse display customer.name contains data more that 20 characters and I want to display the full data.

entendi ?
 
the help says the format is for the cells.. so not sure it will work on coulmns... you could try setting the format using the coulmn:buffer-field:format = "x(30)"
 
yes, compiler did not like hBrowse:FORMAT = "X(40)".
COLUMN:buffer-field:format = "x(30)" ?? how do I set this ?
hBrowse:COLUMN:buffer-field:format = "x(30)" ??

muito obriga...
 
I recently needed to do this.
Try adding a bit of this code:

Code:
DEFINE VARIABLE hBrowse AS WIDGET-HANDLE NO-UNDO.
DEFINE VARIABLE hbrCol  AS WIDGET-HANDLE NO-UNDO.
DEFINE VARIABLE iIndex  AS INTEGER       NO-UNDO.

DO iIndex = 1 TO hBrowse:NUM-COLUMNS :
   ASSIGN hbrCol = hBrowse:GET-BROWSE-COLUMN(iIndex).
   IF hbrCol:BUFFER-FIELD:NAME = 'Customer.Name':U THEN ASSIGN hbrCol:BUFFER-FIELD:FORMAT = 'X(40)':U.
END.
 
Back
Top