As you know, getLastSelectedIndex() method of TEXTGRIDCollection returns the index of the last selected item. According to the API it should return -1 when no line is selected.
When I remove the selected line, I also expect it to return -1. However it depends on which remove method you use :!:
If you use remove(Object) method it works as it should and returns -1. But if you use remove(int) method it returns the index of the DELETED LINE :!: