Thanks for the suggestion. However the gridview does not have a selected
item template. DataList does.
--
Richard T. Henry
Lewisberry, PA- Hide quoted text -
- Show quoted text -
Ah I see. Yes you are right if the GridView had a template option for
the selected row then it would be called "SelectedRowTemplate" rather
than "SelectedItemTemplate" ("item" is DataList terminology). DataList
is of course template only.
The alternative is to add a template column to the GridView and put
the the image control in there (or alternatively add an image to an
existing templated column if preferred). Set the visible property of
the image to false in the designer.
Then write some code for both the SelectedIndexChanging event and the
SelectedIndexChanged event.
In the SelectedIndexChanging event handler check for a non-negative
value of SelectedIndex and if so set the image visible property to
false in the SelectedRow (use the FindControl() method of the
SelectedRow object to retrieve it). This will hide the image for the
previously selected row if it existed.
In the SelectedIndexChanged event handler set the visible property of
the image in the SelectedRow to true. This will show the image for the
newly selected row.
HTH
(BTW I know the above works because I tried it).