1

I am using SPGridView. I want to fill textboxes with the SPGridview Selected Row Data on a button click event.

Does anyone know how to do that?

My code:

txtCode= SPGridView.SelectedRow.Cell[1].Text;

But when debugging it shows Cell[1] is empty even though it is showing data in the Grid.

Any ideas?

Thanks SAAD

2 Answers 2

1

is SPGridView.SelectedRow.Cell[1].Text empty? Or is SPGridView.SelectedRow.Cell[1] null?

If it's not null, have a look at SPGridView.SelectedRow.Cell[1].Controls, maybe there is a LiteralControl contained in the cell or something that contains the text you are looking for.

2
  • SPGridView contain data ,its not null or empty.
    – sbtahir
    Commented Apr 19, 2010 at 4:27
  • Did you read the answer? Commented Apr 21, 2010 at 21:27
0

Assuming that txtCode is a TextBox should that not read

txtCode.Text = SPGridView.SelectedRow.Cells[1].Text;
1
  • having same problem with txtCode.text
    – sbtahir
    Commented Apr 19, 2010 at 6:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.