DataGrid's DataKeyField Value (C#)

A

A. Atienza

Hi all,

I have a DataGrid control (parent) and a Repeater control (child) in my
webform. In my Repeater_ItemDataBound event, I would like to get the value
of the current DataGrid row's DataKeyField. How can I do this?

Thank you for any help you can provide.

Arlynn
 
M

Michael Tkachev

Hi,

Repeater r =
(Repeater)e.Item.Cells[0].Controls.FindControl("RepeaterControlID");
object o = r.Items.SelectedItem;

Something like this... :)

bye

Mike
 

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,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top