Allowing my method to "see" that a row has already been selected from my gridview.

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Allowing my method to "see" that a row has already been selected from my gridview.

Hello,

My program has a gridview. It allows someone to select one of the rows.
I store the selected row info using the following:

GridViewRow row = GridView1.SelectedRow;

Later on in the code, I was to call a method I wrote that needs to use "row" (i.e. the data stored in that row in the gridview).

An exception is thrown saying that "Object reference not set to an instance of an object." I believe the method thinks that nothing has been selected....but it has been selected before this part of the code is called.

How can I make my method "see" that the row has been selected and therefore go ahead and use "row" (the instance of GridViewRow that was instantiated earlier)