e.CommandArgument.ToString()
((Label)gv.SelectedRow.FindControl("lblId")).Text
FindControl
Text
protected void grdView_RowCommand(object sender, GridViewCommandEventArgs e) { string strUserID =((Label)grdView.Rows[Convert.ToInt32(e.CommandArgument)].FindControl("lbluserid")).Text; }
GridView.DataKeyNames = new string[] { "ID" };
GridView_RowDeleting
int ID = Convert.ToInt32(GridView.DataKeys[e.RowIndex].Value);
protected void grdView_RowCommand(object sender, GridViewCommandEventArgs e) { Dim index = Convert.ToInt32(e.CommandArgument) Dim row = ProductsGridView.Rows(index) Dim labelText = CType(row.FindControl("LabelName"), Label).Text } I hope this will help you.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)