2011-10-03 58 views
1

XAML:WPF:组合框的DataTemplate

<dxe:ComboBoxEdit x:Name="UserSelectComboBox" Margin="68.497,31.75,0,48.213" 
    Background= {DynamicResource TextBoxBackground}" Height="{DynamicResource 
    TextBoxHeight}" FontSize="{DynamicResource TextFontSize}" 
    HorizontalAlignment="Left" Width="149.333" Text="{Binding 
    SelectedItemValue, ElementName=UserSelectComboBox, Mode=OneWay}"> 
    <dxe:ComboBoxEdit.ItemTemplate> 
     <DataTemplate> 
    <StackPanel Orientation="Horizontal"> 
     <Image Source="{Binding UImages, Converter= {StaticResource 
       byteToImageConverter}}" Width="40" Height="40"/> 
     <TextBlock Text="{Binding UId}" Margin="5,0,0,0"/> 
    </StackPanel> 
    </DataTemplate> 
    </dxe:ComboBoxEdit.ItemTemplate> 
</dxe:ComboBoxEdit> 

我使用DevExpress的组合框。当我在ComboBox中选择任何项目时,其文本显示Procesta.CvServer.Class.Propertys.UserTeamView这是我的绑定源名称。

enter image description here

我只想显示UID。

+0

在DevExpress组合框中没有文本搜索属性。我在找哪个。感谢所有 – Vero009

回答

1

您正在绑定TextSelectedItemValue。改为尝试绑定到SelectedItemValue.UId