Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > How to get the DataKeyField in the DataGrid ?

Reply
Thread Tools

How to get the DataKeyField in the DataGrid ?

 
 
Kylin
Guest
Posts: n/a
 
      05-31-2005
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:
ICQ:156134382



 
Reply With Quote
 
 
 
 
Brock Allen
Guest
Posts: n/a
 
      05-31-2005
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.

-Brock
DevelopMentor
http://staff.develop.com/ballen



> 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!




 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
DataGrid - DataKeyField!! Adam Knight ASP .Net 0 08-07-2005 02:33 PM
DataGrid's DataKeyField Value (C#) A. Atienza ASP .Net Datagrid Control 1 12-07-2004 08:23 AM
Newbie question: ASP Datagrid + Complex DataKeyField Homer J. Simpson ASP .Net 2 03-05-2004 06:34 PM
how to get datagrid item index from DataKeyField value? Sean ASP .Net Datagrid Control 1 08-07-2003 12:11 AM



Advertisments