This question is locked. New answers and comments are not allowed.
Hi..
I have the following ComboBox in a DataForm and in the Edit Template. The value shows fine in the Read Only Template. But when I Bind the current values does not show and is not selected. The value SUBTYPE has a corresponding value in the Item Source. The dropdown displays the correct values and I can make a selection. But when loaded the ComboBox is blank and the value not selected.
Any idea what I'm doing wrong? thanks!!!!!!!!!!!!!!!!!!!!
<telerik:RadComboBox x:Name="comboSubType" Margin="5,0,0,0" Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2" IsEnabled="True" HorizontalAlignment="Left" CanAutocompleteSelectItems="true"
ItemsSource ="{Binding SubCategories_Filtered,Source={StaticResource ViewModel}}"
SelectedValue="{Binding SubType, UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}"
SelectedValuePath="SubCategory1"
DisplayMemberPath="SubCategory1"
Style="{StaticResource RadComboBoxStyle}" Loaded="comboSubType_Loaded"
Height="30" Width="200" >
</telerik:RadComboBox>
SubCategories_Filtered looks like this
private List<SubCategory> _filteredsubcatgories;
public List<SubCategory> SubCategories_Filtered
{
get
{
if (_filteredsubcatgories == null)
{
this.SubCategories_Filtered = new List<SubCategory>();
}
return _filteredsubcatgories;
}
set
{
_filteredsubcatgories = value;
this.RaisePropertyChanged("SubCategories_Filtered");
}
}
and this...
[MetadataTypeAttribute(typeof(SubCategory.SubCategoryMetadata))]
public partial class SubCategory
{
// This class allows you to attach custom attributes to properties
// of the SubCategory class.
//
// For example, the following marks the Xyz property as a
// required property and specifies the format for valid values:
// [Required]
// [RegularExpression("[A-Z][A-Za-z0-9]*")]
// [StringLength(32)]
// public string Xyz { get; set; }
internal sealed class SubCategoryMetadata
{
// Metadata classes are not meant to be instantiated.
private SubCategoryMetadata()
{
}
public string Category { get; set; }
public int ID { get; set; }
public string SubCategory1 { get; set; }
}
}
I have the following ComboBox in a DataForm and in the Edit Template. The value shows fine in the Read Only Template. But when I Bind the current values does not show and is not selected. The value SUBTYPE has a corresponding value in the Item Source. The dropdown displays the correct values and I can make a selection. But when loaded the ComboBox is blank and the value not selected.
Any idea what I'm doing wrong? thanks!!!!!!!!!!!!!!!!!!!!
<telerik:RadComboBox x:Name="comboSubType" Margin="5,0,0,0" Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2" IsEnabled="True" HorizontalAlignment="Left" CanAutocompleteSelectItems="true"
ItemsSource ="{Binding SubCategories_Filtered,Source={StaticResource ViewModel}}"
SelectedValue="{Binding SubType, UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}"
SelectedValuePath="SubCategory1"
DisplayMemberPath="SubCategory1"
Style="{StaticResource RadComboBoxStyle}" Loaded="comboSubType_Loaded"
Height="30" Width="200" >
</telerik:RadComboBox>
SubCategories_Filtered looks like this
private List<SubCategory> _filteredsubcatgories;
public List<SubCategory> SubCategories_Filtered
{
get
{
if (_filteredsubcatgories == null)
{
this.SubCategories_Filtered = new List<SubCategory>();
}
return _filteredsubcatgories;
}
set
{
_filteredsubcatgories = value;
this.RaisePropertyChanged("SubCategories_Filtered");
}
}
and this...
[MetadataTypeAttribute(typeof(SubCategory.SubCategoryMetadata))]
public partial class SubCategory
{
// This class allows you to attach custom attributes to properties
// of the SubCategory class.
//
// For example, the following marks the Xyz property as a
// required property and specifies the format for valid values:
// [Required]
// [RegularExpression("[A-Z][A-Za-z0-9]*")]
// [StringLength(32)]
// public string Xyz { get; set; }
internal sealed class SubCategoryMetadata
{
// Metadata classes are not meant to be instantiated.
private SubCategoryMetadata()
{
}
public string Category { get; set; }
public int ID { get; set; }
public string SubCategory1 { get; set; }
}
}