Hi,
We're exeriencing some odd behaviour with the XamComboEditor... When initially bound (MVVM) to an empty collection, the editor will be set to an assumed expanded default height containing no values. Upon the bound collection being poplated, the height of this control (when expanded) appears to be set to zero, even though there are a number of values now present. (This can be confirmed by dragging the control to a size that displays all of the values).
Does anyone know why the height of this control is reset to zero and how we can get around this issue?
Thanks,
Rob
Hello Rob,
Are you referring to the height as the height of the XamComboEditor itself or the dropdown height? I tried to reproduce this, but the height of the editor really depends on its container type and the positioning properties. What kind of layout are you using?
It's just the drop-down height (the height of the editor itself is fine and the elements within it have all been given a padding of zero as we've found that when populated to an enum, they tend to gain a little height when compared to non-populated editors).
<Style x:Key="EnumItemTemplate"> <Setter Property="ComboBox.ItemTemplate"> <Setter.Value> <DataTemplate> <TextBlock Text="{Binding}" Padding="0"/> </DataTemplate> </Setter.Value> </Setter> </Style>
<Editors:XamComboEditor x:Name="rulesEnum" Width="110" Value="{Binding RulesEnum, ValidatesOnDataErrors=True}" ItemsSource="{Binding Path=ValidRules}" ComboBoxStyle="{StaticResource EnumItemTemplate}"> </Editors:XamComboEditor>
(Pardon the fomatting on the above, it wouldn't paste very nicely as markup!)
The scenario can be replicated (at least on our side) with two drop-down controls with exactly the same styling and performing the following steps. Note that the values of the second drop-down depend on the value selected from the first:
I hope this sheds a little more light.
Many thanks,
Hey Alex,
Thank you for that example. Annoyingly, it works fine... From your example, I think it will be easier to see where we're going wrong.
Thanks again,
I followed your steps and created the following sample. I was not able to reproduce this when testing against latest service release for 10.1 on Windows 7. Please run the attached project and let me know if you can reproduce this. I even used the template you provided and still the issue was not reproducible. Have you tried setting the Min/MaxDropDownHeight properties of the XamComboEditor?