Thanks for all your replies and suggestions
finally i made my code working with the help of parent key as suggested by muddasar and links followed ths links above.
So this is what i have used,
As i have said in my question
i have a button inside child grid view
with commandname add
so inside childgrid_rowcommand,
if the command name matches
1-- i am taking the index of selected row of childgrid view and get the value stored in literal (which was not the issue i faced)
2-- i need to get the value of parent datakey which has been selected,
so here we go,
GridView ParentGridView = (GridView)(gvProc.Parent.Parent.Parent.Parent.Parent);
i have got the parent gridview here ,
next,
GridViewRow GVR = gvProc.Parent.Parent.Parent as GridViewRow;
its the parent gridviewrow
now getting the index which has been seleted,
int index11 = GVR.DataItemIndex;
here is the selected datakey value,
int id =Convert.ToInt32(ParentGridView.DataKeys[index11].Value.ToString());
there may be other ways to get the same,but i found this one working
Thanks once again all of you ,
Posting this answer if it may help someone in future :)