>>>>>>>I can dynamically disable all rows in a grid leaving only the
>>>>>>>current row enabled (after an append). However the user can still
>>>>>>>move the record pointer to another row by clicking. How can I
>>>>>>>prevent this ?
>>>>>>>
>>>>>>>Regards Ian
>
>Cetin,
>
>Thanks for the code. I've managed to get the current grid row to lock.
>However, i've needed to alter the .top/.bottom settings of the grid,
>which i don't understand (see code). Any suggestions on what i'm missing ...?
>
>LPARAMETERS nColIndex
>
>LOCAL llChangingRow, lnRowPos, lnColPos
>
>llChangingRow = .F.
>STORE 0 TO lnRowPos, lnColPos
>
>IF Thisform.Navigate.EditMode
> *< Add/edit mode ... >*
> IF MDown()
> lnBottom = This.Top+This.HeaderHeight+(This.RelativeRow*This.RowHeight)
> lnTop = lnBottom - This.RowHeight
>
> *< ???? Top=7 HeaderHeight=23 RowHeight=23 >*
> lnBottom = lnBottom + 28
> lnTop = lnTop + 34
>
> lnRowPos = MROW(WONTOP(),3)
> lnColPos = MCOL(WONTOP(),3)
>
> llChangingRow = !BETWEEN(lnRowPos,lnTop,lnBottom) AND ;
> BETWEEN(lnColPos,This.Left,This.Left+This.Width)
>
> *Messagebox("Row: "+str(lnRowPos)+" Bottom: "+str(lnBottom)+" Top: "+str(lnTop))
> ELSE
> llChangingRow = INLIST(LASTKEY(),24,5,28,3,145,148)
> ENDIF && MDown
>
> IF llChangingRow
> NODEFAULT
> ELSE
> *< Do nothing >*
> ENDIF && llChangingRow
>ELSE
> *< Do nothing >*
>ENDIF && Thisform.Navigate.EditMode
>
>Regards Ian
Ian,
Couldn't clearly understand what you mean change top/bottom settings of grid and the need for +28, +34. However while trying what you mean I realized that I ignored gridlinewidth (there is a little zone -one pixel or two- where it seems that you're not changing row but in fact changing) and updated the code as :
lnTop = .top+.headerheight + 2 + ;
(.relativerow - 1) * .rowheight + int(.gridlinewidth/2)
lnBottom = .top+.headerheight + 1 + ;
.relativerow * .rowheight - int(.gridlinewidth/2)
By saying change top/bottom do you mean ie: current control is something like combo with sparse=.t. and you want the rowheight be taller when column getsfocus ?
Cetin