Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

How to show an error message when a record cannot be deleted

$
0
0

This example demonstrates how to show an error message when an attempt to delete a record is cancelled by the RowDeleting event handler.

Question Comments

Added By: Rabab Siblini at: 3/16/2016 11:18:39 PM    Tanks, it works exactly as I want , but I didn't user the exception class , I check it as such :

 protected void gvDiscounts_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)        {            if (CannotDelete)                throw new Exception("DeleteError");        }

  protected void gvDiscounts_CustomErrorText(object sender, ASPxGridViewCustomErrorTextEventArgs e)        {            if (e.Exception.Message == "DeleteError")                e.ErrorText = e.Exception.Message;        } Added By: Vova (DevExpress Support) at: 3/17/2016 1:57:07 AM    

Thank you for sharing your idea with our community, Rabab. It may be useful for other users trying to complete a similar task.

Best regards,
Vova


Viewing all articles
Browse latest Browse all 7205

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>