How to get the DataKeyField in the DataGrid ?

K

Kylin

I set the DataKeyField in a DataGrid ,
and an EditCommand ,
when I click the EditCommand ,
I want to get the row's DataKeyField ,
and redirect to other page like this Item.aspx?id=XXX
the XXX jut equal the DataKeyField 's value ?

how can I do this ?
and I have a long tiem to try it ,
but Not OK!


--
FireCrow Studio
Kylin Garden
QQ:462042991
MSN:[email protected]
ICQ:156134382
 
B

Brock Allen

If you have the DataGridItem's ItemIndex, then you can index into the DataGrid's
DataKeys collection. The DataGridItem is available in the EditCommand via
the DataGridCommandEventArgs parameter.
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top