Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to force the grid to Activate the first column?
Message
From
09/04/2004 09:12:35
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00893497
Message ID:
00893519
Views:
31
>Thank You Fabio

hi Borislav,

In addition to Fabio's answer

You can add a method to the grid which returns the first column (users can move columns around)
&& then
local FirstColumn
FirstColumn = thisform.Grid1.GetFirstEnabledColumn()

if( !isNull(FirstColumn) )
    =FirstColumn.SetFocus()
endif

&&Grid.GetFirstEnabledColumn
** loop through columns

local _col, mincol, mincolorder, i

mincol = Null

for i = 1 to this.ColumnCount
	_col = this.Columns[i]
	if( !_col.ReadOnly and _col.Enabled and _col.Visible )
		if( IsNull(mincol) )
			mincol = _col
			mincolorder = _col.ColumnOrder
		else
			if( _col.ColumnOrder < MinColOrder )
				Mincol = _col
				Mincolorder = _col.ColumnOrder
			endif
		endif
	endif
endfor

return MinCol
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform