oBrowse:colcount hidden columns

This forum is for eXpress++ general support.
Post Reply
Message
Author
skiman
Posts: 1195
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

oBrowse:colcount hidden columns

#1 Post by skiman »

Hi,

I have a browse with hidden columns. How can I get ALL the columns of the browse? Seems as colcount doesn't show the hidden columns.
Best regards,

Chris.
www.aboservice.be

User avatar
Tom
Posts: 1205
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: oBrowse:colcount hidden columns

#2 Post by Tom »

A browse can't hide columns. If you use the HIDE clause with eXpress++, the columns are deleted and added again, depending on the result of the HIDE-clause.
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

User avatar
SlavkoDam
Posts: 111
Joined: Wed Apr 27, 2022 10:12 am
Location: Negotin, Serbia
Contact:

Re: oBrowse:colcount hidden columns

#3 Post by SlavkoDam »

Hi,
Tom, browse columns can be hidden/shown, but not in eXpress++. Roger use simple oCol:hide()/oCol:show() for that, but it does not do the task well. I described how to do that correctly in this post:
viewtopic.php?f=2&t=3211

Cris, to get all columns in a browser you can use this: oCol:setParent():childList(), where oCol is any column in a browser.
You can also use this: oBrw:aColumns, where :aColumns is a READONLY variable.

Slavko
Best regards,

Slavoljub Damnjanovic
SD-SoftDesign, Alaska Software Technology Partner
https://www.sd-softdesign.com
https://www.sd-softdesign.rs

skiman
Posts: 1195
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: oBrowse:colcount hidden columns

#4 Post by skiman »

Hi Tom, Slavko,

Thanks for the insights.
Best regards,

Chris.
www.aboservice.be

User avatar
rdonnay
Site Admin
Posts: 4774
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: oBrowse:colcount hidden columns

#5 Post by rdonnay »

I added the ability to collapse and restore columns in SqlQuery.prg.

Your columns would need to first use the DCBROWSECOL .. SUBCLASS 'DD_XbpBrowseFiltered()'

Code: Select all

CLASS DD_XbpColumnFiltered FROM DC_XbpColumnFiltered

EXPORTED:

VAR nColumnWidth
VAR isCollapsed

INLINE METHOD Init(a,b,c,d,e,f,g)

LOCAL oColumn

::isCollapsed := .f.

oColumn :=::DC_XbpColumnFiltered:init(a,b,c,d,e,f,g)

::isColumnConfigEnabled := .t.

RETURN oColumn

* -----------

INLINE METHOD Collapse( lResizeBrowse )

DEFAULT lResizeBrowse := .t.

IF !::isCollapsed
  ::nColumnWidth := ::currentSize()[1]
  ::setSize({0,::currentSize()[2]})
  ::hide()
  ::isCollapsed := .t.
  IF lResizeBrowse
    ::parent:setSize(::parent:currentSize())
  ENDIF
ENDIF
RETURN self

* ------------

INLINE METHOD Restore( lResizeBrowse )

DEFAULT lResizeBrowse := .t.

IF ::isCollapsed
  ::setSize({::nColumnWidth,::currentSize()[2]})
  ::show()
  ::isCollapsed := .f.
  IF lResizeBrowse
    ::parent:setSize(::parent:currentSize())
  ENDIF
ENDIF
RETURN self

ENDCLASS
The eXpress train is coming - and it has more cars.

Post Reply