Hi
I need to get the value of the textbox so that I could change the item source accordingly. How could I do this?
Hello mheusser,
Which XamComboEditor are you using? The WPF only one or the shared one? The WPF only version has a Text property which you can use. http://help.infragistics.com/doc/WPF/2013.2/CLR4.0/?page=InfragisticsWPF4.Editors.v13.2~Infragistics.Windows.Editors.ValueEditor~Text.html
If you are using the shared version you are going to have to traverse the visual tree starting at the editor and go down till you find SpecializedTextBox. You can use the Infragistics.Windows.Utilities class to make this easier.
SpecializedTextBox tb = (SpecializedTextBox)Infragistics.Windows.Utilities.GetDescendantFromType(myComboEditor1, typeof(SpecializedTextBox), false);
http://help.infragistics.com/doc/WPF/2013.2/CLR4.0/?page=InfragisticsWPF4.v13.2~Infragistics.Windows.Utilities~GetDescendantFromType(DependencyObject,Type,Boolean).html
http://help.infragistics.com/doc/WPF/2013.2/CLR4.0/?page=InfragisticsWPF4.Controls.Editors.XamComboEditor.v13.2~Infragistics.Controls.Editors.Primitives.SpecializedTextBox.html
Let me know if you have any questions on this.
I'm using the shared version. With your suggested code I get a null value.
My code:
<UserControl x:Class="PrestImmo.Infrastructure.CustomControls.LabelComboEditor" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:ig="http://schemas.infragistics.com/xaml" x:Name="LCE">
<Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto"/> <ColumnDefinition Width="*"/> </Grid.ColumnDefinitions>
<TextBlock x:Name="tbl" Text="{Binding ElementName=LCE, Path=LabelText}" Height="{Binding ElementName=LCE, Path=LabelHeight}" Width="{Binding ElementName=LCE, Path=LabelWidth}" VerticalAlignment="Center"/> <ig:XamComboEditor x:Name="xce" Grid.Column="1" Height="{Binding ElementName=LCE, Path=ComboBoxHeight}" Width="{Binding ElementName=LCE, Path=ComboBoxWidth}" HorizontalContentAlignment="{Binding ElementName=LCE, Path=HorizontalContentAlignment}" VerticalAlignment="Center" ItemTemplate="{Binding ElementName=LCE, Path=ItemTemplate}" ItemsSource="{Binding ElementName=LCE, Path=ItemsSource}" DisplayMemberPath="{Binding ElementName=LCE, Path=DisplayMemberPath}" SelectedValuePath="{Binding ElementName=LCE, Path=SelectedValuePath}" SelectedValue="{Binding ElementName=LCE, Path=SelectedValue, Mode=TwoWay}"/> </Grid></UserControl>
Constructor:
public LabelComboEditor(){ InitializeComponent(); var s = (SpecializedTextBox)Infragistics.Windows.Utilities.GetDescendantFromType(xce, typeof(SpecializedTextBox), false);}