Click here to Skip to main content
16,023,103 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I am adding a new row at the footer of the Gridview but i am not getting values in the textboxes.
Also i have made the Gridview directly editable.

When i make a simple application without making Gridview editable the code to add row works fine but if I use add row with editable Gridview it does not get values.
Please help following is my code:
C#
protected void GridView3_RowCommand(object sender, GridViewCommandEventArgs e)
{              
        if (e.CommandName == "Submit")
        {
            string prodid = ((TextBox)ddgrnstatus.FooterRow.FindControl("ProdId")).Text;
            string Dis_Id = ((TextBox)ddgrnstatus.FooterRow.FindControl("P_displayId")).Text;
            string ProdName = ((TextBox)ddgrnstatus.FooterRow.FindControl("ProductName")).Text;
            string MaxQty = ((TextBox)ddgrnstatus.FooterRow.FindControl("MaxQty")).Text;
            string MinQty = ((TextBox)ddgrnstatus.FooterRow.FindControl("MinQty")).Text;
            string ReorderQty = ((TextBox)ddgrnstatus.FooterRow.FindControl("ReorderQty")).Text;
            string Qtyonhand = ((TextBox)ddgrnstatus.FooterRow.FindControl("qtyonhand")).Text;       
        }
}
Posted
Updated 18-May-10 23:33pm
v2

You must be doing something wrong. Full code is not here so...

Have a look at these articles:
NewRow GridView[^]
GridView Examples for ASP.NET 2.0: Displaying Summary Data in the Footer[^]
 
Share this answer
 
Hi
You are adding the grid view row dynamically....if you are trying to edit a row in grid the new row data you will lose because the page load is happening and the dynamically added row data wont be there becauser you are not priserving any where....so my suggetion is store the data what you have added dynamically in page init not in page load because you won't get that data in page load.....if i understand u r problem wrongly...sory dude

Please let me know if this is usefull

Regards
Vinay
 
Share this answer
 

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