Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Datagrid Control (http://www.velocityreviews.com/forums/f60-asp-net-datagrid-control.html)
-   -   How to get the DataKeyField in the DataGrid ? (http://www.velocityreviews.com/forums/t762035-how-to-get-the-datakeyfield-in-the-datagrid.html)

Kylin 05-31-2005 12:31 AM

How to get the DataKeyField in the DataGrid ?
 
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:GaoTianpu@hotmail.com
ICQ:156134382




Brock Allen 05-31-2005 04:56 AM

Re: How to get the DataKeyField in the DataGrid ?
 
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!






All times are GMT. The time now is 10:08 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.