I have a custom line number field in opportunity product tab for customer to re-sequence the selected products and the grid is sorted on custom field value.
I am trying
You can implement RowInserting Event handler as below:
graph.RowInserting.AddHandler((cache, args) =>
{
var soLine = (SOLine)args.Row;
CROpportunityProducts opProduct = PXResult.Current;
SOLineExtNV soLineExt = PXCache.GetExtension(soLine);
CROpportunityProductsExtNV opProductExt = PXCache.GetExtension(opProduct);
soLineExt.UsrLineNo = opProductExt.UsrLineNo;
});