2011/11/07

Get the Current Row Index on RowCommand event in Gridview Data Control


GridViewRow row = (GridViewRow)(((LinkButton)e.CommandSource).NamingContainer);
int strCurrentRowIndex = row.RowIndex;
GridViewRow selectedRow = grdDetail.Rows[strCurrentRowIndex];
string clientname = selectedRow.Cells[0].Text;


Note: this is will return the first column value of the current row.

No comments:

Post a Comment

 What is AI? Artificial Intelligence (AI) is the ability of machines or computer systems to perform tasks that normally require human intell...