This is a migrated thread and some comments may be shown as answers.

[Solved] Custom errror message in RADgrid

2 Answers 115 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Harry
Top achievements
Rank 1
Harry asked on 07 Aug 2009, 07:59 AM
Hi,

I've a radgrid in my application that updates my record in the database by inline rowediting. When i try to update a record that after editing violates a unique contstraint in my Oracle database, the pop-up message "exception has been thrown by the target of an invocation" is shown in the webpage.

Now I like to show my own custom error messages (that the unique constraint is violated), instead of the standard "exception has been..." error message.

Can you please help me with this?

Thanks in advance,
Cheers,
Tim.

2 Answers, 1 is accepted

Sort by
0
Accepted
Daniel
Telerik team
answered on 07 Aug 2009, 08:40 AM
Hello Tim,

You can try the following approach:
try 
    //something 
catch (Exception ex) 
    if (ex is System.Reflection.TargetInvocationException && ex.Message == "Exception has been thrown by the target of an invocation"
    {  
        //do something 
    } 

I hope this helps.

Best regards,
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Harry
Top achievements
Rank 1
answered on 07 Aug 2009, 09:35 AM
Hi Daniel,

This helped. Thanks for your quick response.

Cheers,
Tim.
Tags
Grid
Asked by
Harry
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Harry
Top achievements
Rank 1
Share this question
or