2
Reply

GridView Cell value cannot fetch

Bineesh  VP

Bineesh VP

Jun 17 2016 7:56 AM
284
Sir,
 
I am in a ASP.NET project. I stuck in code piece to fetch GridView cell value into a variable.  Data being fetched from database in page load(if !PostBack). then all cell value become null when come to the RowCommand event. why that happening?
 
 
Here the code:-
int EmpID = Convert.ToInt32(((GridViewRow)(((LinkButton)e.CommandSource).NamingContainer)).Cells[1].Text); 

Answers (2)