This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I'm using the DropDownEditBox as part of a custom PropertyEditor in my app. An inner PropertyGrid displays the properties of the item selected from the DropDownEditBox's list. That works well for a while, but after switching between objects in the outer PropertyGrid or changing properties with the dropdown list, I start to notice some odd things happening with the DropDownEditBox.
I do not see these same issues when using a standard ComboBox instead of a DropDownEditBox. However, I need to use the DropDownEditBox because eventually I want to include a search box filter at the top of the dropdown list, something I can't do with a ComboBox. I've attached a sample app, PropEdPlus, that exhibits the problems. (You can see the difference between using a ComboBox vs. a DropDownEditBox by commenting/uncommenting the #define directive in the first line of the VINPropertyEditor.cs file.) The list of vehicles in stock are shown in the list box at the top (where you can view any changes to their properties made in the inner PropertyGrid below). When the user selects one of the Vehicles for Sale in the middle list, the outer PropertyGrid appears below. A DropDownEditBox is used to select from the list of available stock vehicles of the desired type. When a vehicle is selected, it's properties appear in the inner PropertyGrid below the DropDownEditBox. To reproduce the problems:
From the data errors shown (and the values in the debug statements from the code) it would seem there is something not correctly working within the DropDownEditBox control. None of these errors or the odd effects shows up if the code is compiled using the standard ComboBox. Can you tell me what I'm doing wrong or how I can work around these issues? Thanks, BillBR |
|
|
Hello BillBR Thanks for the description and sample project. I'll be able to look into this for you tomorrow. Jason Fauchelle |
|
|
Hello BillBR To solve the first 2 issues, simply make Car implement the INotifyPropertyChanged interface. (The members have been implemented, but the interface itself has been forgotten). For the 3rd issue, here is what's happening:
This is easy to fix by only closing the DropDownEditBox if your Data property changes. You could do this by changing DropDownList_SelectionChanged like this:
As for the errors in the output, unfortunately these are proving to be difficult to resolve. I know these can be annoying to see, but they can be safely ignored. I have noted these down to try and resolve another time. Jason Fauchelle |
|
|
Thanks for taking a close look at this, Jason. And especially for catching a stupid oversight on my part! When I added the INotifyPropertyChanged code to the PickupTruck and Car classes, I copy/pasted the code in the property, but forgot to include the interface on the Car class. Doh! The explanation for the third issue makes sense and your suggested fix works perfectly. I can live with the data errors so long as I know they can be safely ignored. Obviously they impact performance a bit, so please add a posting to this thread when you've had a chance to clear them up. That way we can grab the latest nightly build and avoid them. Thanks once again for you excellent support! BillBR |
|