Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
i have gridview. i have entered some data into grid view. after that i clicked on save button.this event goes to GetLatestDataFromGrid method.there its giving error

C#
protected void SavePlanningGoods()
   {
       
           DataTable lDtLatestInfo;
           lDtLatestInfo = GetLatestDataFromGrid();
}


private DataTable GetLatestDataFromGrid()
   {


       DataTable lDtMenuDisplay = obj.gridTableSchema();
       DataRow lDrMenuDisplay;

       foreach (GridView lgPlanningGoods in gvPlanningGoods.Rows)--here i m getting error
       {
           Label lblsupcat = (Label)lgPlanningGoods.FindControl("lblsupcat");
           TextBox txtYear = (TextBox)lgPlanningGoods.FindControl("txtYear");
           TextBox txtPeriod = (TextBox)lgPlanningGoods.FindControl("txtPeriod");
           DropDownList drpCategory = (DropDownList)lgPlanningGoods.FindControl("drpCategory");
Posted

1 solution

Change it to...
C#
foreach (GridViewRow lgPlanningGoods in gvPlanningGoods.Rows)
 
Share this answer
 
Comments
TrushnaK 24-Jan-14 23:57pm    
exactly... 5+
Thanks. :)

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