Hi telerik experts,
I'm using the telelik combobox with the data bind to an ObservableCollection of a custom object.
Basically, this combo is used to show an image with the flag and respective country code to allow the user to change the language of the application.
So, I have got the following helpers:
The cultureInfoItem class, that stores the infoID and the respective flag image
The combobox is binded to:
So, I add, remove, edit the items and the combo box is always updated. This works fine.
Then the xaml part, the combo box is defined in the following way:
When I set the callback to take care of the SelectionChanged event, it doesn't even load the web page:
Afterwards:
Code-behind:
Error:
The line and position points to SelectionChanged="cmbCultureSelection_SelectionChanged"
What am I doing wrong?
Thanks for all the help,
Luís Miguel Pinho
P.S.: I'm using version Q1 2009
I'm using the telelik combobox with the data bind to an ObservableCollection of a custom object.
Basically, this combo is used to show an image with the flag and respective country code to allow the user to change the language of the application.
So, I have got the following helpers:
The cultureInfoItem class, that stores the infoID and the respective flag image
public class CultureInfoItem : INotifyPropertyChanged, IEquatable<CultureInfoItem> |
{ |
private string cultureInfoID; |
public string CultureInfoID |
{ |
get { return cultureInfoID; } |
set |
{ |
cultureInfoID = value; |
if (PropertyChanged != null) |
PropertyChanged(this, new PropertyChangedEventArgs("CultureInfoID")); |
} |
} |
private string cultureInfoFlag; |
public string CultureInfoFlag |
{ |
get { return cultureInfoFlag; } |
set |
{ |
cultureInfoFlag = value; |
if (PropertyChanged != null) |
PropertyChanged(this, new PropertyChangedEventArgs("CultureInfoFlag")); |
} |
} |
public CultureInfoItem(string cultureID) |
{ |
CultureInfoID = cultureID; |
CultureInfoFlag = string.Format("/SilverlightStatusBarTesting;component/Images/Flags/{0}.png", cultureID); |
} |
} |
The combobox is binded to:
internal ObservableCollection<CultureInfoItem> cultureInfoCollection; |
So, I add, remove, edit the items and the combo box is always updated. This works fine.
Then the xaml part, the combo box is defined in the following way:
<telerikInput:RadComboBox x:Name="cmbCultureSelection" HorizontalAlignment="Center" VerticalAlignment="Center" Width="50" Height="22" Margin="2,2,2,2" Opacity="0.80" Grid.Row="1" Grid.Column="3"> |
<telerikInput:RadComboBox.ItemTemplate> |
<DataTemplate> |
<StackPanel Orientation="Horizontal"> |
<Image Source="{Binding Path=CultureInfoFlag}" Height="11" Margin="2,2,2,2"/> |
<TextBlock Text="{Binding Path=CultureInfoID}" FontFamily="Verdana" FontSize="9" VerticalAlignment="Center" /> |
</StackPanel> |
</DataTemplate> |
</telerikInput:RadComboBox.ItemTemplate> |
</telerikInput:RadComboBox> |
When I set the callback to take care of the SelectionChanged event, it doesn't even load the web page:
SelectionChanged="cmbCultureSelection_SelectionChanged" |
Afterwards:
<telerikInput:RadComboBox x:Name="cmbCultureSelection" HorizontalAlignment="Center" VerticalAlignment="Center" Width="50" Height="22" Margin="2,2,2,2" Opacity="0.80" Grid.Row="1" Grid.Column="3" SelectionChanged="cmbCultureSelection_SelectionChanged"> |
<telerikInput:RadComboBox.ItemTemplate> |
<DataTemplate> |
<StackPanel Orientation="Horizontal"> |
<Image Source="{Binding Path=CultureInfoFlag}" Height="11" Margin="2,2,2,2"/> |
<TextBlock Text="{Binding Path=CultureInfoID}" FontFamily="Verdana" FontSize="9" VerticalAlignment="Center" /> |
</StackPanel> |
</DataTemplate> |
</telerikInput:RadComboBox.ItemTemplate> |
</telerikInput:RadComboBox> |
Code-behind:
private void cmbCultureSelection_SelectionChanged(object sender, Telerik.Windows.Controls.SelectionChangedEventArgs e) |
{ |
} |
Error:
Unhandled error in Silverlight 2 Application |
AG_E_PARSER_BAD_PROPERTY_VALUE (Line:54 Position: 221) |
The line and position points to SelectionChanged="cmbCultureSelection_SelectionChanged"
What am I doing wrong?
Thanks for all the help,
Luís Miguel Pinho
P.S.: I'm using version Q1 2009