I am not quite sure but I think you shouldn't specify that you only want the first page directly in the url where the subgrid load the data from. You are not specifying it on the subgrid construction but you are when selecting a row on the master grid. As you are using pagers for both your master and detail grid, you should rely on it to specify the desired page to the server.
But I don't think the problem comes from here.
Also, have you checkec that your databse actually return a positive count when querying the folowwing query directly?:
“SELECT COUNT(*) AS count FROM invlines WHERE inv_id=6”