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

[Solved] Hanlding error : ID is neither a DataColumn nor a DataRelation for table

3 Answers 193 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kelly
Top achievements
Rank 1
Kelly asked on 03 Jul 2014, 12:10 PM
We know that this error means that RadGrid is unable to find the aforementioned datakey in your datasource. and we need to correct the datasource. But somehow if this error still comes then is there a way to handle it generously and show some user friendly message by catching this error.

Which event we can catch this error in code behind as we need to catch when this type of error comes and show some friendly message like "System error occured"

Please help

3 Answers, 1 is accepted

Sort by
0
Radoslav
Telerik team
answered on 08 Jul 2014, 07:03 AM
Hello Kelly,

To achieve the desired functionality I suggest you to use a custom error page. More information you can find here:
http://www.asp.net/web-forms/tutorials/deployment/deploying-web-site-projects/displaying-a-custom-error-page-cs

Also I am sending you a simple example which demonstrates it.

I hope this helps.

Regards,
Radoslav
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Kelly
Top achievements
Rank 1
answered on 09 Jul 2014, 10:25 AM
Thanks for the reply but I was expecting some exception type rather than general exception to catch when this type of error comes.
Don't we have any specific exception type apart from the general Exception for this error.
like we have SQLException for sql errors.
0
Radoslav
Telerik team
answered on 10 Jul 2014, 07:42 AM
Hi Kelly,

Unfortunately into the current implementation of the RadGrid you cannot handle this exception because it is fired internally between page events. The only possible approach is to use error page like I suggest you. However I will forward your requirement to our developers for further consideration. Also you can log a feature request into our public portal in order other people to vote for it:
http://feedback.telerik.com/Project/108

Regards,
Radoslav
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Kelly
Top achievements
Rank 1
Answers by
Radoslav
Telerik team
Kelly
Top achievements
Rank 1
Share this question
or