Ryan Thomas

Ryan Thomas

  • NA
  • 13
  • 21.1k

gridview selected item to textbox

Aug 4 2010 5:36 PM

i have read many forums relating to getting the value of the selected row from the gridview and setting it to a textbox, however i cannot copy the code to my project. the code i have frequently seen is:
 
string selectedItem = MyGridView.SelectedRow.Cells[1].Text;
textboxItem.Text = selectedItem;
 
However in my Vis studio, the .SelectedRow is unavailable but instead SelectedRows is available, this completely messes the code up as it cannot be compiled. Is there a reason why i cannot use Row instead of rows
 
any help would be much appreciated
thanks

Answers (2)