Hello,
I've a combobox defined as
<telerik:RadComboBox Grid.Row="0" IsEditable="true" SelectedItem="{Binding SelectedDateMode=TwoWay}"
x:Name="ComboBox" Height="30" Width="150" ItemsSource="{Binding Collection, Mode=OneWay}"
ItemTemplateSelector="{StaticResource itemTemplateSelector}" OpenDropDownOnFocus="True" />
and the template I'm going to use is
<DataTemplate x:Key="datetimeDataTemplateSelector">
<TextBlock Text="{Binding Data}"/>
</DataTemplate>
it's bound to an object of type
public class TestObject : INotifyPropertyChanged
{
public bool IsGeneric { get; set; }
public DateTime? Data { get; set; }
public event PropertyChangedEventHandler PropertyChanged;
public void NotifyPropertyChanged(string propertyName)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
}
and when the dropdown is open I got the data shown.. when I select an Item I got for the itemtemplate RadControlsWpfApp2.TestObject
Since I cannot specify a DisplayMember how can I tell to show the Data value?
Thanks
I've a combobox defined as
<telerik:RadComboBox Grid.Row="0" IsEditable="true" SelectedItem="{Binding SelectedDateMode=TwoWay}"
x:Name="ComboBox" Height="30" Width="150" ItemsSource="{Binding Collection, Mode=OneWay}"
ItemTemplateSelector="{StaticResource itemTemplateSelector}" OpenDropDownOnFocus="True" />
and the template I'm going to use is
<DataTemplate x:Key="datetimeDataTemplateSelector">
<TextBlock Text="{Binding Data}"/>
</DataTemplate>
it's bound to an object of type
public class TestObject : INotifyPropertyChanged
{
public bool IsGeneric { get; set; }
public DateTime? Data { get; set; }
public event PropertyChangedEventHandler PropertyChanged;
public void NotifyPropertyChanged(string propertyName)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
}
and when the dropdown is open I got the data shown.. when I select an Item I got for the itemtemplate RadControlsWpfApp2.TestObject
Since I cannot specify a DisplayMember how can I tell to show the Data value?
Thanks