Click here to Skip to main content
Sign Up to vote bad
good
See more: C#ASP.NET
Hi friends,
 
please give solution for this issue
 
Right now we were worked on gridview under three gridviews .Please find below formate.

ParentGridview ---MainGrid
ChildGridview1 -----Child1
ChildGridview2 -----Child2
ChildGridview3 -----Child3

 

Now we want edit ChildGridview2. how can we get ChildGridview2 edit values in ChildGridview2_Rowcommand.

we unable ger e.commandName value in ChildGridview2_Rowcommand
 

protected void ChildGridview2_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e)
       {
           if (e.CommandName == "Edit")
           {
               int i = ((GridViewRow)((ImageButton)e.CommandSource).NamingContainer).RowIndex;
               int l =((GridViewRow)((GridViewRow)((GridViewRow)((ImageButton)e.CommandSource).NamingContainer).Parent.Parent.Parent.Parent)).RowIndex;
               int m =((GridViewRow)((GridViewRow)((GridViewRow)((ImageButton)e.CommandSource).NamingContainer)).Parent.Parent.Parent.Parent).RowIndex;
               //string ClientID = ((HiddenField)((GridView)ParentGridview.Rows[l].FindControl("ChildGridview1")).Rows[i].FindControl("hfProjectID")).Value;

 

               int EmployeeID = Convert.ToInt32(((HiddenField)((GridView)((GridView)ParentGridview.Rows[l].FindControl("ChildGridview1")).Rows[i].FindControl("ChildGridview2")).Rows[m].FindControl("hfEmpolyeeID")).Value);
 
               int ClientID = Convert.ToInt32(((HiddenField)((GridView)((GridView)ParentGridview.Rows[l].FindControl("ChildGridview1")).Rows[i].FindControl("ChildGridview2")).Rows[m].FindControl("hfclient")).Value);
              string Day = ((HiddenField)((GridView)((GridView)ParentGridview.Rows[l].FindControl("ChildGridview1")).Rows[i].FindControl("ChildGridview2")).Rows[m].FindControl("hfdate")).Value;
              string Query = EmployeeID.ToString()+"/" + ClientID.ToString()+"/" + Day;
 
              Response.Redirect("EditTimecard.aspx?val=" + Query);
 
           }
 
       }
Posted 28 Feb '13 - 3:04


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 414
1 Arun Vasu 223
2 OriginalGriff 190
3 CPallini 163
4 Aarti Meswania 158
0 Sergey Alexandrovich Kryukov 10,169
1 OriginalGriff 7,749
2 CPallini 4,181
3 Rohan Leuva 3,482
4 Maciej Los 3,089


Advertise | Privacy | Mobile
Web02 | 2.6.130523.1 | Last Updated 28 Feb 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid