Button Field in Grdview control

B

BW

I am a newbie to ASP.NET and have a question about a button field I have
added to a gridview. When you click on the button I want to update a
label with the value from a datakey. the issue I have with this is that by
clicking the button it isn'tchange the selected index of the gridview. How
do I set the selected index to the current row?

Thanks
BW
 
T

Teemu Keiski

Hi,

set CommandName="Select" to the ButtonField. You'll get the index of the row
automagically in RowCommand via e.CommandArgument (even when you'd use other
command name than Select as long as RowCommand runs)
 

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,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top