It would have been better if you would have included the rendered HTML for gridview. Even then please check the following things -
1. Check if you are using the right attribute selectors.
2. Check if you have got the right tr
3. If you are using label in case of Total, please check it should render a span rather than an input.
And, you can write the code like -
var stockData = [];
$("table[id$='gvstockOut'] input[id$='txtstockId']").each(function(){
var stockItem = {};
var closestParentTr = $(this).parents('tr')[0];
stockItem.StockId = $(this).val();
stockItem.particular = $(closestParentTr).find("input[id*='txtParticulars']").val();
stockItem.Quantity = $(closestParentTr).find("input[id*='txtQuantity']").val();
stockItem.Rate = $(closestParentTr).find("input[id*='Rate']").val();
stockItem.Value= $(closestParentTr).find("input[id*='lblTotal']").val();
stockData.push(stockItem);
});
var stockJSONData = JSON.stringify(stockData);
Note: I have just rewritten your code for making it easier to debug. So, please check the above mentioned points first.
And, check using any debugger or putting console.log after each value you are getting. So, that will make you clear if you are getting the right value or not.
Thanks