Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Grid problem

Status
Not open for further replies.

DannC

Programmer
Apr 5, 2001
75
RO
Hi guys & girls !

Does any of U know if I a grid object can be "feeded" from a array. Something like a controlsource. Thank's.
 
In one of my old programe, I used a similar function to push the Unwanted columns in a preformated grid to set display order. This is very similar to your requiremnents. Hope you can get the idea from this.
*******************
I made the basegrid with
**
InitEvent
=========
WITH THIS
.SetAll("DynamicBackColor", ;
"IIF(recno(This.RecordSource)=THIS.inRecno, ;
RGB(0,255,0),RGB(255,255,192))","COLUMN")

&& Catch the input columnOrder in an array. This is used
&& to push columns with VISIBLE=.F. to the right of Grid.
&& Actual pushing is done in the Refresh Method.
IF .ColumnCount > 0
DECLARE .aColumnOrder(.ColumnCount,2)
For I = 1 TO .ColumnCount
.aColumnOrder(I,1) = .Columns(I).ColumnOrder
.aColumnOrder(I,2) = I
ENDFOR
=ASORT(.aColumnOrder)
ENDIF
ENDWITH
**EOF
***************************************
RefreshEvent
============
&& SET THE ORIGINAL COLUMN ORDER FIRST
&& AND ALSO SET THE NON VISIBLE COLUMNS TO THE LAST COLUMN
WITH THIS
IF .ColumnCount > 0
LOCAL lnNewOrder
lnNewOrder = 1
For I = 1 TO .ColumnCount
IF .Columns(.aColumnOrder(I,2)).Visible
.Columns(.aColumnOrder(I,2)).ColumnOrder = lnNewOrder
lnNewOrder = lnNewOrder + 1
ELSE
.Columns(.aColumnOrder(I,2)).ColumnOrder = .ColumnCount+1
ENDIF
ENDFOR
ENDIF
ENDWITH
**EOF

ramani :)
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
 
Hello.

Maybe you'll APPEND FROM ARRAY in a temporary table (create with CREATE CURSOR) and use the table as RowSource.

Hope this helps. Grigore Dolghin
Class Software
Bucharest, Romania
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top