This question is locked. New answers and comments are not allowed.
Not sure which forum to post this is in since I am using OpenAccessDataSource and a RadWindowManager.
When the Updated event is called on the OpenAccessDataSource, I am checking for an exception and am trying to use the WindowManager to give feedback to the user. It seems that if the DB returns an exception that the windowmanager won't display the exception. To test, use the below code. In the DB, I have a GUID column and whatever else. While in edit mode, if I attempt to remove some characters from the Guid and click Update an exception is thrown and I get the display from windowmanager. This is because the source is mscorlib PRIOR to the DB update being called. Now, if I change something else that will cause the DB to generate an exception (i.e. pass 10 characters in to a column that is nvarchar(2)). The Update event is still thrown, the exception is caught, but the windowmanager never displays the informaiton. It seems like the page is attempting to be redrawn after a DB error so the RadAlert is never displayed.
And the code behind:
When the Updated event is called on the OpenAccessDataSource, I am checking for an exception and am trying to use the WindowManager to give feedback to the user. It seems that if the DB returns an exception that the windowmanager won't display the exception. To test, use the below code. In the DB, I have a GUID column and whatever else. While in edit mode, if I attempt to remove some characters from the Guid and click Update an exception is thrown and I get the display from windowmanager. This is because the source is mscorlib PRIOR to the DB update being called. Now, if I change something else that will cause the DB to generate an exception (i.e. pass 10 characters in to a column that is nvarchar(2)). The Update event is still thrown, the exception is caught, but the windowmanager never displays the informaiton. It seems like the page is attempting to be redrawn after a DB error so the RadAlert is never displayed.
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
></
telerik:RadScriptManager
>
<
telerik:RadWindowManager
ID
=
"_windowManager"
DestroyOnClose
=
"true"
Opacity
=
"100"
runat
=
"server"
AutoSizeBehaviors
=
"Default"
EnableShadow
=
"true"
Modal
=
"true"
Skin
=
"Forest"
></
telerik:RadWindowManager
>
<
telerik:RadGrid
ID
=
"_timeFailures"
runat
=
"server"
DataSourceID
=
"_employeeTimeEntries"
AllowAutomaticInserts
=
"True"
AllowAutomaticUpdates
=
"True"
GridLines
=
"None"
Skin
=
"Forest"
AutoGenerateEditColumn
=
"True"
AllowPaging
=
"True"
AutoGenerateDeleteColumn
=
"True"
CellSpacing
=
"0"
>
<
MasterTableView
DataKeyNames
=
"TimeLogID"
></
MasterTableView
>
</
telerik:RadGrid
>
<
telerik:OpenAccessDataSource
ID
=
"_employeeTimeEntries"
runat
=
"server"
ObjectContextProvider
=
"Keeley.Barcode.DAL.KeeleyBarcodeDataContext, Keeley.Barcode.DAL"
TypeName
=
"Keeley.Barcode.DAL.TimeLog"
onupdated
=
"_timeFailuresDataSource_Updated"
>
</
telerik:OpenAccessDataSource
>
</
form
>
And the code behind:
protected void _timeFailuresDataSource_Updated(object sender, Telerik.OpenAccess.OpenAccessDataSourceChangedEventArgs e)
{
if (e.Exception != null)
{
_windowManager.RadAlert(e.Exception.Message, null, null, "Error", null);
e.ExceptionHandled = true;
}
}