Javascript Confirmation Dialog for Datagrid Select?

J

Joey

I am using a datagrid with a SELECT button to determine which record to
delete. The code behind pulls the selected item's record number (via a
hidden column) in the grid with SelectedItem.Cells[x].Text, and then
uses a stored procedure to delete the record.

I need to wire up a javascript confirmation dialog (Are you sure you
want to delete this record? Yes/No) to it. Any suggestions on how to do
this?
 
S

S. Justin Gengo

Joey,

Use the ItemDataBound event of the grid.

I have sample code at: http://www.aboutfortunate.com?page=codelibrary that
makes a row clickable. To do that I'm adding a javascript to the row and
hiding the Select Button column. But with a few little tweaks you could use
the code to still show the select button, grab it and add your javascript
confirm to it. To find the code use the search text box on the page and type
"clickable datagrid".

If you have any questions feel free to email me.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 

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,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top