>There, I got it finally - thank you. Now for minor enhancements to the grid.
>
>1) Can I control the position of the cursor? When user clicks on header to change sort order, can I move the position of the cursor to that column?
Sure you can. Add to Header.click():
this.parent.setFocus()
>2) I would like to activate the enter key. Now, if you click on the Exit button, it will transfer which row the cursor is currently on - kind of awkward. I would like to be able to press enter on the selected record and exit to the original form.
You can change it in the Ingrid textbox class KeyPress event. But for the time being do not touch the class code, just add this functionality right into KeyPress event of every Ingrid textbox instance in your grid.
* Keypress Event
LPARAMETERS nKeyCode, nShiftAltCtrl
DODEFAULT(nKeyCode, nShiftAltCtrl)
IF nKeyCode = 13 && Enter
*your_code_here && (maybe Thisform.Release() )
ENDIF
>3) How can I change the highlighting of the headings based on which row the sort is effective in?
Add to Header.Click() something like:
IF your_condition_here
this.backColor = RGB(255,0,0) && Red
ELSE
this.backColor = RGB(0,255,0) && Green
ENDIF
or you may use DO CASE statement.
>These are just minor issues, but I think it will be clearer to understand for the end user. Thanks again!!
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro
"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison