We've just upgraded to version 9.3, and now have an issue with the ComponentAdded event of the XRDesignPanel (End User Designer) no longer providing populated DataBinding properties for the added component. I rely on the count of these bindings for creating field caption labels when dragging fields from the field list (an approach I came up with as detailed in Q215553), as well as the actual field it's bound to (for looking up the user friendly name) in order to provide the caption.
I see B141510 talks about a very similar issue (the Parent property not being populated), and the solution there was to use the GetControlByScreenPoint method to find the newly created control. I'm reluctant to use this, as I foresee problems when the new field is dropped on top of an existing one and there are two possible controls that the method could return. Is there a more reliable way of either finding the newly dropped control, or having the DataBindings (along with Parent and whatever other properties may no longer be getting filled) populated correctly?
What is the reason behind no longer populating these properties? Surely this must be breaking a lot of other peoples' code as well??
The majority of the code in the main application isn't required to reproduce the issue; it's purpose is all logic based to work around copying/pasting bound fields, calculating label coordinates and so on. The attached sample simply shows a message box with the number of databindings on the control being dropped onto the report. Run the example, go to the Field List and drag '1' onto the report; the messagebox shows '0'. Once you close this the control appears, along with it's 1 databinding. This messagebox would have shown '1' on the old version. Also try dragging a label from the left toolbar; this will show '0' as well. My aim is to get access to the databinding of the label as it's dragged from the field list - I need both the count and the fieldname.
Thank you for your feedback and provided sample. I'm afraid you're referring to an actual XtraReports issue. Therefore, I've converted your question to a bug report and changed its subject. Our developers will continue the research in order to determine what goes wrong. We will keep you informed about our progress.
Is your intention to post an answer to your own question?
- If so, then proceed.
- If you simply wanted to post additional information, ask for further clarification, or to just say "Thanks!", please click Leave a Comment.
- If you wish to edit your original question, please use the Edit button in the Toolbox at the top right corner of that entry.