G
gnewsgroup
I searched around and it seems no one has ever run into this.
I am using a CommandField (although an extended CommanField from
http://www.codeproject.com/KB/aspnet/ExtendedCommandField.aspx for the
added client confirmation feature) for row deletion in a GridView.
The GridView is wrapped up in the Ajax UpdatePanel. Everything is
working OK, except a little drawback, i.e., when one tries to delete
something that's NOT deletable in the database, the AJAX framework
catches the SqlException and displays it in a popup like this one:
http://farm3.static.flickr.com/2324/2109035498_d9c592a501_o.png
How do I handle this particular delete event of a CommandField
manually, so that I can display a customized message like "Another
table is referring to this order and thus it cannot be deleted."?
I know that I can do this if I use a TemplateField instead of a
CommandField, but that would mean a lot more code to write.
I am using a CommandField (although an extended CommanField from
http://www.codeproject.com/KB/aspnet/ExtendedCommandField.aspx for the
added client confirmation feature) for row deletion in a GridView.
The GridView is wrapped up in the Ajax UpdatePanel. Everything is
working OK, except a little drawback, i.e., when one tries to delete
something that's NOT deletable in the database, the AJAX framework
catches the SqlException and displays it in a popup like this one:
http://farm3.static.flickr.com/2324/2109035498_d9c592a501_o.png
How do I handle this particular delete event of a CommandField
manually, so that I can display a customized message like "Another
table is referring to this order and thus it cannot be deleted."?
I know that I can do this if I use a TemplateField instead of a
CommandField, but that would mean a lot more code to write.