ImageButton in a datagrid. How do I determine on which row I am?

T

ThunderMusic

Hi,

I have an ImageButton in a DataGrid (each row has it's ImageButton). When I
click on this ImageButton, I must delete a row in my database. As a result,
I must know on which ImageButton the user clicked (well, on which row). How
can I do that? it's probably very simple, but I really don't know how to do
it.

Thanks

ThunderMusic
 
Z

Zamdrist

I have used the UpdateCommand Sub of the Datagrid to grab the valued of
the active row, if you will.

ByVal E As System.Web.UI.WebControls.DataGridCommandEventArgs

That is an argument used in the UpdateCommand.

Therefore: E.Item.Cells(1).Text retrieves the my primary key needed for
the update.

Someone else who knows datagrids better than I might be able to explain
it better though :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top