how to get grid view datakey value in nested grid view in gridview_RowCommand
i have used this code but here it will not detecting grid view name
protected void gvDetails_RowCommand(object sender, GridViewCommandEventArgs e)
{
string tempid = "";
switch (e.CommandName)
{
case "cmdbtn":
int currentRowIndex = Convert.ToInt32(e.CommandArgument);
GridViewRow row = gvDetails.Rows[currentRowIndex];
//GridView gvDetails = (GridView)FindControl("gvDetails");
string showId = (string)gvDetails.DataKeys[0].Value.ToString();
string[] id = showId.Split('.');
int index = Convert.ToInt16(e.CommandArgument.ToString());
tempid = gvDetails.Rows[index].Cells[0].Text;
// string lid = ((Label)gvDetails.Rows[e.RowIndex].FindControl("lblLoginId")).Text;
string imgid = gvDetails.Rows[index].Cells[0].Text;
// string[] id = imgid.Split('.');
string imageid = id[0];
var result = Regex.Match(imageid, @"\d+").Value;
DataSet template = AdminTemplate.Gettemplateenable(result);
string enablecoustimze = Convert.ToString(template.Tables[0].Rows[0]["Customize_Enable"]);
if (enablecoustimze == "True")
{
Session["imageid"] = result;
Response.Redirect("EditDemo.aspx?img=Upload/Temp/customize/" + imageid + "&Orderid=" + tempid);
}
else
{
ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Template Cannot be Customized. Please Contact The Administrator ')", true);
}
break;
}
Session["imageid"] = tempid;
//Response.Redirect("EditDemo.aspx");
}
i have used this code but here it will not detecting grid view name