0

i need a code sample to capture the value of a record id from the selected row so that i can send it as a parameter to the oracle procedure that deletes the record.

thanks

3
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by viswa_007
0

What do you have so far? How much do you know about the underlying DataRowView model to a GridView?

http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.rowdeleting.aspx

The trick is when the event triggers, it will return a DataRowView that you can pull data from. You just have to figure out the column you want.

This page should provide some insight if you view the source via the link at the bottom of the page:

http://authors.aspalliance.com/aspxtreme/sys/web/ui/webcontrols/demos/gridviewrowdeleting.aspx

0

if ur control is a grid view then the code to capture the selected row's id in a string is:
string str = GridView1.SelectedDataKey.Value.Tostring()
Note: Set the Datakeyname from the propertiers of the GridView control to your table's id name and then write the above line of code in gridview's selectedindex change event

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.