Click here to Skip to main content
15,885,887 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,


I have a nested grid(parent grid1,child grid2).i am displaying grid2 on row command event of grid1. I am trying to update grid2 on rowcommand event of grid2 but its not binding properly. I found through breakpoint that latest reocrds are binding grid2 but it is not displaying latest records.
Posted
Comments
Rajesh waran 21-Oct-14 2:48am    
Just find the child grid properly and bind it.

What have you tried? Show us that code. Maybe there is a problem with your binding.
You could refer Editable Nested GridView (All-in-One)
 
Share this answer
 
protected void ParentGrid_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "Update")
{
ImageButton img = (ImageButton)e.CommandSource as ImageButton;
GridViewRow row = img.NamingContainer as GridViewRow;
            
GridView chil= (GridView )row.FindControl("ChildgridId");
 
SqlCommand cmd=new SqlCommand("select * from table",connectionstring);
Dataset ds;
SqlDataAdapter ad=new SqlDataAdapter(cmd);
ad.Fill(ds);
Bind the values from the query to Chil datasource
 
chil.DataSource=ds;
chil.DataBind();
 
}
 
}
 
Share this answer
 
Hi Sravan,
Here i give you one link kindly go threw in that link that will really help to do nested gridview editable.
Nested-gridview-Edit


[^]


Thanking you!
 
Share this answer
 
v3

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900