0

やあ、

アイテムのリストにバインドされた Telerik コンボ ボックスがあります。それはそれらをうまく表示します。変更したいのは、別のオブジェクトのプロパティをコンボボックスの文字列の先頭に追加することだけです。

現在、コンボ ボックスには"ListOfItems.Name"が表示されています。"Object.Property --- ListOfItems.Name"

   <telerik:RadComboBox x:Name="radComboBox" ItemsSource="{Binding ListOfItems}" DisplayMemberPath="Name" SelectedItem="{Binding SelectedName, Mode=TwoWay}"/>

の線に沿った何か

   <telerik:RadComboBox x:Name="radComboBox" ItemsSource="{Binding ListOfItems}" DisplayMemberPath="String.Append(Object.Property --- Name)" SelectedItem="{Binding SelectedName, Mode=TwoWay}"/>

XAML コードでこれを行うにはどうすればよいですか?

4

1 に答える 1

3

何をしたいのか完全には理解できませんが、正しく理解している場合は、RadComboBox の ItemTemplate プロパティを使用する必要があります。

<telerik:RadComboBox x:Name="radComboBox"
                 ItemsSource="{Binding ListOfItems}"
                 SelectedItem="{Binding SelectedName, Mode=TwoWay}">
<telerik:RadComboBox.ItemTemplate>
    <DataTemplate>
        <StackPanel Orientation="Horizontal">
            <TextBlock Text="Object.Property"></TextBlock>
            <TextBlock Text=" --- "></TextBlock>
            <TextBlock Text="{Binding Name}"></TextBlock>
        </StackPanel>
    </DataTemplate>
</telerik:RadComboBox.ItemTemplate>

于 2012-09-06T14:10:54.277 に答える