Anele Ngqandu

Anele Ngqandu

  • NA
  • 19
  • 38.6k

How to find a cell value from ASP.Net gridview

Jun 16 2011 1:58 PM
Am trying to get cell value from a columm and am geting the error below:

Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index


This is my code but am not sure about it and i cant call the column by name it does not allow me to do that.

protected void btnSearchEmployees_Click(object sender, EventArgs e)
{ string n = grdAvailableStuff.Rows[2].RowIndex.ToString();
MessageBox.Show(n);
}

Answers (19)