Hello, is there a way to prevent that a XamComboEditor extents his horizontal width when the text of the MultiSelectedValues is growing? The control sits inside a Grid that might changed by user: The width of the control should follow the with of the Grid Column. I am using the shared version of the XamComboEditor. btw: It would be great if the WPF version can offer the same functions and properties like the shared one.
Thanks
Niko
Hello Niko,
Thank you for the code-snippet you have provided.
Since the XamComboEditor you have provided appears to contain references to a style that I cannot refer to, I was not able to reproduce the issue.By removing the style and using another ItemsSource as an example, the issue does not seem to be reproduced.
Would you please modify the sample I have attached, so the issue is reproduced and send it back to me? Having this information will help me further investigate this matter for you.
If you have any questions, please let me know.
Hello Tacho,
I was not precise on my question: The XamComboEditor sits inside a regular grid.
I would like that in this scenario that the XamComboEditor does not change the Width on his own, that he only scales with the Grid.
<Grid Grid.Column="2" Grid.Row="4" > <Grid.ColumnDefinitions> <ColumnDefinition Width="1*" /> <ColumnDefinition Width="1*" /> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> </Grid.RowDefinitions> <Label Grid.Column="0" Grid.Row="0" Content="Farbe in Berichten" /> <ig:XamColorPicker Grid.Column="1" Grid.Row="0" SelectedColor="{Binding BaustellenFarbe, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" Style="{Binding Source={StaticResource ControlBaseStyle}}" TabIndex="105" IsEnabled="{Binding IsParent, UpdateSourceTrigger=PropertyChanged}" DerivedPalettesCount="10" ShowDerivedColorPalettes="True" CurrentPalette="{StaticResource WindowsStandardColorPalette }"> </ig:XamColorPicker> <Label Content="Sichtbar für" Grid.Column="0" Grid.Row="1" /> <ig:XamComboEditor AllowMultipleSelection="True" ItemsSource="{Binding Bau2Org}" DisplayMemberPath="Organisationseinheit" CustomValueEnteredAction="Ignore" Grid.Column="1" Grid.Row="1" Style="{Binding Source={StaticResource ControlBaseStyle}}" TabIndex="106" AutoComplete="True" AutoCompleteDelay="50" IsSelectedMemberPath="IsSelected" CheckBoxVisibility="Visible"> </ig:XamComboEditor> </Grid>
Thank you for the description of the issue you have provided.
Presuming you are using a TemplateColumn for displaying the shared XamComboEditor in the XamGrid (by default, the XamGrid uses the MS ComboBox), in order to stretch the editor so it occupies the entire width of the column, I can suggest you set the HorizontalContentAlignment property of the column to Stretch.
XAML:
<ig:TemplateColumn Key="Sizes" HorizontalContentAlignment="Stretch"> <ig:TemplateColumn.ItemTemplate> ... </ig:TemplateColumn.ItemTemplate> <ig:TemplateColumn.EditorTemplate> ... </ig:TemplateColumn.EditorTemplate></ig:TemplateColumn>
<ig:TemplateColumn.EditorTemplate> ... </ig:TemplateColumn.EditorTemplate></ig:TemplateColumn>
I have attached a sample application that demonstrates the approach from above.