Hello dear supporters,
I have a problem that allways at the first try in a Webapplication the Keyproperty-Value of an nested Listview is not correctly delivered by the 'ASPXGridView' which is behind and I get an ArgumentException…
Is there any 'model' setting which i have not done?
CodeThe error occurred:
Type: ArgumentException
Message: Cannot convert the 'WPS5.Module.BusinessObjects.Schweisser(493)' value to the type of the 'WPS5.Module.BusinessObjects.Schweisser' key property type, error: Die Eingabezeichenfolge hat das falsche Format.
Data: 0 entries
Stack trace:
bei DevExpress.ExpressApp.Xpo.XPObjectSpace.GetObjectKey(Type objectType, String objectKeyString)
bei DevExpress.ExpressApp.Web.Editors.ASPx.ASPxGridViewContextMenu.SelectObject(String objectId)
bei DevExpress.ExpressApp.Web.Editors.ASPx.ASPxGridViewContextMenu.ProcessCommand(String args)
bei DevExpress.ExpressApp.Web.Editors.ASPx.ASPxGridViewContextMenu.DevExpress.ExpressApp.Web.Templates.IXafCallbackHandler.ProcessAction(String parameter)
bei DevExpress.ExpressApp.Web.Templates.XafCallbackManager.ProcessAction(String parameter)
bei DevExpress.ExpressApp.Web.Templates.XafCallbackManager.callbackControl_Callback(Object source, CallbackEventArgs e)
bei DevExpress.Web.ASPxCallback.OnCallback(CallbackEventArgs e)
bei DevExpress.Web.ASPxCallback.RaiseCallbackEvent(String eventArgument)
bei DevExpress.Web.ASPxWebControl.System.Web.UI.ICallbackEventHandler.RaiseCallbackEvent(String eventArgument)
InnerException is null
Can anyone give me a hint, why that happens.
And why it only happens at the first 'time'. When I press 'back' in the exceptionhandling message and do the 'Action' again, all works perfectly well.
Thank you
Thomas
It appears that the grid control's KeyFieldName property is not set in this case. However, it is unclear under what circumstances this may happen. This property is initialized in multiple places, and this code covers all scenarios we know. Please provide a sample project demonstrating your scenario.
If you want to debug the issue on your side using our PDBs, put a breakpoint into the ASPxGridListEditor.UpdateKeyFieldName method and compare the results when the issue occurs and when the selection is handled correctly after pressing "back".
The KeyFieldName is allways set correctly, but the way how to Execute the Action 'ListViewShowObject' is different.
When click first time on a row (to open it), the event runs over the
XafCallbackManager.ProcessAction
and
IXafCallbackHandler.ProcessAction(string parameter)
and doesnt work.
The second try runs over
XafCallbackManager.ProcessAction and
then selects a diffrent handler and rund through the
ListViewFastCallbackHandlerController.ProcessAction
which handles the parameter correctly.
Thomas
The first try runs through the ASPxGridViewContextMenu.ProcessAction method…
This one processes the parameter in a wrong way.
The second try runs through the ListViewFastCallbackHandlerController.ProcessAction method…
This one processes the parameter in a correct way.
The parameter is in both situations the same:
XafAction:ListViewShowObject:WPS5.Module.BusinessObjects.Schweisser(1582)
Hello, Thomas.
According to the error message, "WPS5.Module.BusinessObjects.Schweisser(493)" was unexpected as a string representation of the Schweisser object key. The actual key property type is likely Int32. So, this string cannot be parsed as a valid number. Unfortunately, the information you provided is insufficient to determine why this string was used instead of a number. Please provide us with a small sample project demonstrating the issue, so that we can build and debug it.
That is a very huge project and i cant send it to you in whole in a public Support-Question.
How I can send you the whole project in a 'secure' way?
Thomas
P.S. ASPxGridViewContextMenu.ProcessAction is 'private' so i cant override it…
Hello Thomas,
Yes, you can upload it to our FTP server. I will provide credentials in the private message.
Thank you for uploading your project. We need some time to review it. We will respond once we have any result.
I will upload a short video with the problem.
Thank you.
Thank you for the additional information. I replicated the issue. We need some additional time to research it. I will get back once we have any results.