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

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top