Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid - row and column information about active cell
Message
From
30/10/2003 05:12:25
 
 
To
30/10/2003 04:28:27
Metin Emre
Ozcom Bilgisayar Ltd.
Istanbul, Turkey
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00843489
Message ID:
00844431
Views:
20
>Hi Gregory,
>Unfortunately no.
>I need grid's activecells .TOP and .LEFT property's values. .top and .left don't work in grids. I need to know what these...

hi Metin,

Let's try

(1) add a method to the form (class) : GetActiveControl()
lparameters	DoNotGoDownIfGrid

local	_ActiveControl, _ActiveColumn, i, x

if( type('thisform.ActiveControl') == T_UNDEFINED )
	return .Null.
else
	_ActiveControl = thisform.ActiveControl
endif

if( !(type('_ActiveControl') == T_OBJECT ) )
	assert FALSE
endif

if( !DoNotGoDownIfGrid and (Proper(_ActiveControl.BaseClass) == 'Grid') )
	_ActiveColumn = _ActiveControl.ActiveColumn
	
	if( !empty(_ActiveColumn) )
		for i = 1 to _ActiveControl.ColumnCount
				x = _ActiveControl.Columns[i]
			if( x.ColumnOrder == _ActiveColumn )
				exit
			endif
		endfor
		for i = 1 to x.ControlCount
			if ( x.Controls[i].Name == x.CurrentControl )
				_ActiveControl	= x.Controls[i]
				exit
			endif
		endfor
	endif
endif

return _ActiveControl
(2) modify the AfterRowColChange of the grid
LPARAMETERS ncolindex

=DoDefault(ncolindex)

local ac
ac = thisform.GetACtiveControl()

do case
case isnull(ac)

otherwise
	acti screen
	?sys(1272, ac)
	?objtoclient(ac, 1)
	?objtoclient(ac, 2)
endcase
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform