How to get values from template fields in GridView?

前端 未结 5 737
伪装坚强ぢ
伪装坚强ぢ 2021-01-05 06:56

This is my markup of GridView.


    
        
            

        
5条回答
  •  梦毁少年i
    2021-01-05 07:21

    For retrieving values do this:

    for (int i = 0; i < GridView2.Rows.Count; i++)
    {
      //extract the TextBox values
      Label lblname= (Label)GridView2.Rows[i].Cells[0].FindControl("lblname");
      Label lblPickUpPoint= (Label)GridView2.Rows[i].Cells[0].FindControl("lblPickUpPoint");
      //Do your excel binding here
    }
    

提交回复
热议问题