Hello dear support,
im using the module common.win from the XVideoRental in my own application.
(Mainly to use the Import-functionality)
Now i wanted to use the Master-Detail-Feature.
I get an InvalidCast Exception when 'expand' an MasterRow.
The DetailView is correctly shown, but a MessageBox with that Exception occurs.
Can anybody give me a hint for that?
23.05.14 16:40:13.670 ================================================================================
The error occurred:
Type: InvalidOperationException
Message: Exception occurs while assigning the 'ListView, ID:Schweisser_Pruefungen_ListView' view to WinWindow:
permissionRequest.TargetObject incompatible with targetObject.GetType()
Data: 0 entries
Stack trace:
bei DevExpress.ExpressApp.Frame.SetView(View view, Boolean updateControllers, Frame sourceFrame)
bei Common.Win.GridView.MasterDetail.GridViewBuilder.ModifyGridViewInstance(IMasterDetailColumnView masterGridView, Int32 rowHandle, Int32 relationIndex, IModelListView masterModelListView, List`1 masterDetailRules) in d:\Visual Studio 2012\Projects\Common.Win\Common.Win\GridView\MasterDetail\MasterDetailBuilders.cs:Zeile 88.
bei Common.Win.GridView.MasterDetail.MasterDetailViewController.Grid_ViewRegistered(Object sender, ViewOperationEventArgs e) in d:\Visual Studio 2012\Projects\Common.Win\Common.Win\GridView\MasterDetail\MasterDetailViewController.cs:Zeile 195.
bei DevExpress.XtraGrid.Views.Grid.GridView.SetMasterRowExpandedEx(Int32 rowHandle, Int32 relationIndex, Boolean expand)
bei DevExpress.XtraGrid.Views.Grid.GridView.VisualSetMasterRowExpandedEx(Int32 rowHandle, Int32 relationIndex, Boolean expand)
bei DevExpress.XtraGrid.Views.Grid.Handler.GridRegularRowNavigator.OnMouseDown(GridHitInfo hitInfo, DXMouseEventArgs e)
bei DevExpress.XtraGrid.Views.Grid.Handler.GridHandler.OnMouseDown(MouseEventArgs ev)
bei DevExpress.Utils.Controls.BaseHandler.ProcessEvent(EventType etype, Object args)
InnerException:
Type: InvalidCastException
Message: permissionRequest.TargetObject incompatible with targetObject.GetType()
Data: 0 entries
Stack trace:
bei DevExpress.ExpressApp.Security.ServerPermissionRequestProcessor.GetTypeToProcess(Type targetType, Object targetObject)
bei DevExpress.ExpressApp.Security.ServerPermissionRequestProcessor.IsGrantedCore(ServerPermissionRequest permissionRequest, IPermissionDictionary permissions, Boolean needToCheckBackReference)
bei DevExpress.ExpressApp.DataManipulationRight.CanDelete(Type type, Object targetObject, CollectionSourceBase collectionSourceBase, IObjectSpace objectSpace)
bei DevExpress.ExpressApp.SystemModule.DeleteObjectsViewController.UpdateActionState()
bei DevExpress.ExpressApp.SystemModule.DeleteObjectsViewController.DoUpdateActionState()
bei System.EventHandler.Invoke(Object sender, EventArgs e)
bei Common.Win.GridView.GridListEditorBase.OnSelectionChanged() in d:\Visual Studio 2012\Projects\Common.Win\Common.Win\GridView\GridListEditorBase.cs:Zeile 811.
bei Common.Win.GridView.GridListEditorBase.gridView_SelectionChanged(Object sender, SelectionChangedEventArgs e) in d:\Visual Studio 2012\Projects\Common.Win\Common.Win\GridView\GridListEditorBase.cs:Zeile 357.
bei DevExpress.Data.SelectionChangedEventHandler.Invoke(Object sender, SelectionChangedEventArgs e)
I circumvent the showing of the Exception by a try catch block…
But why that exception is shown?
Hi Thomas.
A sample can tell us why, we better not guessing but it looks like a a master-detail security non supported issue.
So, if I understand you correctly, i should try to switch off the security system. Just Tod check whether this is the reason? It also occurs when logged in AS an admin.
My question is which types are 'compared'… perhaps my model has an error… thats why im asking.
Hello,
Yes switching of security is not a solution, From the info you posted it looked like a non supported Security issue with master-detail objects. Also from the trace I can understand that there is a miss configuration in your detailed listview. If you want us to examine the case further please post a sample.
Hello, dear supporters,
I will try to pack one tomorrow at work. Thank You for your answers so far.
Thomas