$INCLUDE "RAPIDQ.INC" 

declare SUB SelectCell  (Col%, Row%, CanSelect%) 
declare sub DrawSelectCell (Col%, Row%, State%, Rect AS QRect)

CREATE Form AS QFORM
        top=10
        left=10
        Width =600    
        Height = 450

    CREATE Grid AS QSTRINGGRID
        top=60
        left=10
        Width =400    
        Height = 300
        FixedRows = 1
        FixedCols = 1
        ColCount = 5
        RowCount = 5
        DefaultRowHeight = 20
        Cell(0,0) = " Age"
        Cell(1,0) = " Comments"
        AddOptions (goRangeSelect )
        onSelectCell=SelectCell
        onDrawCell=DrawSelectCell
    END CREATE
    CREATE Label1 AS QLABEL
Caption = "Label1":
Left = 4:Top = 4:
Transparent = 0
Width = 250
    END CREATE

    Caption = "Dropdown list example"
    Center
END CREATE
form.ShowModal

'**************************************************************'
SUB SelectCell  (Col%, Row%, CanSelect%) 

Label1.CAption="Row="+str$(row%)+" CanSelect="+str$(CanSelect%)
print 
end sub

'**************************************************************'
sub DrawSelectCell (Col%, Row%, State%, Rect AS QRect)
print "Col%=",Col% ," Row=" ,Row%," State=" ,State%
with grid
if State%=1  then                               '&hE1D2C9
 .FillRect(Rect.Left, Rect.Top, Rect.Left+.ColWidths(Col%), Rect.Top+.RowHeights(Row%), clLBlue)
end if
end with
'print "---------------------------  end sub"
end sub

