Silverlight combobox number of items shown refresh -
I have two combo boxes on an SL page when combo 1 update, a service called Combo2 and generates .
On the first call, 3 results are returned when the combo box is expanded, then you can see all 3 options.
On the second call, 4 results are returned. When the combo box is expanded, you can see 3 options with a vertical scroll bar.
If I reload and repeat those steps in reverse, then I will get 4 rows in the first line and 3 rows + one empty line on the second call (no, not a blank record. Can be done.)
It appears that the size of the drop down list keeps the first generated height.
How I combo
Edit # 1
The code adheres to the MV-VM pattern. When the page loads, Group 1 populates the first combo box, and nothing is selected. When the user makes a selection, then the selection is limited to group 1 section.
& lt; Combo box itemsource = "{binding path = group 1}" selected isam = "{bound path = group 1 selection}" /> & Lt; Combo box item source = "{binding path = group 2}" selected item {"{binding path = group 2 selection}" /> In view modal, group 1 selections in the property's accelerator, I have something like this
set {if (group1Selection ! = Value) {group1 selection = value; PopulateGroup2 (); OnPropertyChanged ("Group1Selection"); }}
Where populat Group 2 async my service call, receives the data, and places that data into the highlighted property of Group2 .
In the "normal" circumstances, this is not a problem, since most options have dozens of possible choices, however, some group 1 options only have 3 or 4 hair options if If one of them has been selected first, then the height of the combo box is set to 3 or 4, respectively, for the rest of the application, rather than maximizing the items shown 8.
MV -VVM, code-there is no code in the back.
This is a known bug in a combo box in Silverlight 2. I think it has been fixed in SL3.
You can fix this by doing the following:
-
Get from the combo box
-
Public class Mycombo box: Concobox
-
Go about the "popup" section of the Concobox inside the onplatform () method
popup thePopup = GetTemplateChild ("Popup") as a popup; FrameworkElement as ThePopupContent = thePopup.Child FrameworkElement; -
Override the OnItemsChanged method
-
Reset the override on-items within the chained system. ; Width dependency properties on popup using the ClearValue (DP) method.
thePopupContent.ClearValue (framework element.print); ThePopupContent.ClearValue (FrameworkElement.HeightProperty);
You can set maximum and minimum height & amp; Width properties if you are also concerned about those people too.
Comments
Post a Comment