Codechef4u is a community for computer professionals,by computer professionals,just like you; who loves sharing and helping each others,Join them
Share your post

Unable to get gridview footer values in RowCommand

Error: 

Unable to get gridview footer values in RowCommand

Solution 1:

Code in the page load should look like this, check whether you are binding the grid view correctly in the Page Load.

if (!IsPostBack)

{

//Bind Grid data here

  LoadGrid();

}

 Solution 2:

You are not using sender in your find control code line.

Example your code like:

    TextBox txtname = (TextBox)GrdProducts.FooterRow.FindControl("txtAddProductName");

   TextBox txtprice = (TextBox)GrdProducts.FooterRow.FindControl("txtAddprice");

This should be:

TextBox txtprice = (TextBox)((GridView)sender).FooterRow.FindControl("txtAddprice");

Share your answer


Share as a guest

Please subscribe me to the CodeChef4U.

By creating your new answer, you agree to the privacy policy and terms of service.