Hello,
The lookup and subgrid are 2 relationships I assume (offcourse they are)? Is the subgrid a N:N relation or a 1:N relation? If it is a N:N you should associate the lookup record with your form record (use the XrmServiceToolkit.Soap.Associate() function on
Button click). If your subgrid is a 1:N relation, retrieve the lookup record and set the 1:N relationship with your form record (XrmServiceToolkit.Rest.Update() function) .
Refresh the grid afterwards?
I hope this will give you a starting point.
Kind Regards