Like so many others before me, I am experiencing this problem.. but with the RadGridView instead of the combo box or list box controls. Here is my XAML..
<UserControl x:Class="MyNamespace.MyActivities"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
BorderBrush="#FF192554"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" Width="Auto" xmlns:telerikInput="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input" xmlns:telerikGridView="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView" xmlns:Telerik_Windows_Controls_GridView="clr-namespace:Telerik.Windows.Controls.GridView;assembly=Telerik.Windows.Controls.GridView">
<Grid x:Name="LayoutRoot">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Visibility="Visible" Width="990" Height="450" Background="{x:Null}">
<telerikGridView:RadGridView Margin="0,0,0,0" x:Name="gridActivities" IsTabStop="True" TabIndex="1" ColumnsWidthMode="None" AutoGenerateColumns="False" IsReadOnly="True" ShowGroupPanel="False" FontSize="12" Height="400" VerticalAlignment="Top">
<telerikGridView:RadGridView.Columns>
<Telerik_Windows_Controls_GridView:GridViewDataColumn HeaderText="Sent Date" DataMemberBinding="{Binding Path=SentDate}" Width="110" DataFormatString="{}{0:d-MMM-yyyy}" />
<Telerik_Windows_Controls_GridView:GridViewDataColumn HeaderText="Details" DataMemberBinding="{Binding Path=Details}" Width="300"/>
<Telerik_Windows_Controls_GridView:GridViewDataColumn HeaderText="Sent To" DataMemberBinding="{Binding Path=ReceivingUser}" Width="240"/>
<Telerik_Windows_Controls_GridView:GridViewDataColumn HeaderText="Client" DataMemberBinding="{Binding Path=Client}" Width="160"/>
<Telerik_Windows_Controls_GridView:GridViewDataColumn HeaderText="ClientID" DataMemberBinding="{Binding Path=ClientID}" Width="110"/>
</telerikGridView:RadGridView.Columns>
</telerikGridView:RadGridView>
</Grid>
<Button Content="Close" Height="30" IsTabStop="True" x:Name="btnClose" FontFamily="Portable User Interface" Background="{x:Null}" BorderBrush="{x:Null}" Foreground="#FFFFFFFF" FontSize="14" Width="140" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Padding="0,0,0,0" HorizontalAlignment="Right" Margin="0,10,10,10" VerticalAlignment="Bottom"/>
</Grid>
</UserControl>
And my code-behind is pretty straightforward, but the close method does this:
void btnClose_Click(object sender, RoutedEventArgs e)
{
gridActivities.ItemsSource = null;
RadWindow window = RadWindow.GetParentRadWindow(this);
window.Hide();
}
The only difference between it and some others I've seem is that I am setting the ItemsSource to null (because the next time it is shown, I may pass in a new datacontext). When I press the close button, everything is OK. When I click the red X close (and I have CloseMode="Hide") I get the exception. As a workaround I set CloseMode="none" but that doesn't instill a lot of confidence that it won't crash some other way.
Any idea if this will be fixed in the Q12009 release (and any idea when its coming)?
<UserControl x:Class="MyNamespace.MyActivities"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
BorderBrush="#FF192554"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" Width="Auto" xmlns:telerikInput="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input" xmlns:telerikGridView="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView" xmlns:Telerik_Windows_Controls_GridView="clr-namespace:Telerik.Windows.Controls.GridView;assembly=Telerik.Windows.Controls.GridView">
<Grid x:Name="LayoutRoot">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Visibility="Visible" Width="990" Height="450" Background="{x:Null}">
<telerikGridView:RadGridView Margin="0,0,0,0" x:Name="gridActivities" IsTabStop="True" TabIndex="1" ColumnsWidthMode="None" AutoGenerateColumns="False" IsReadOnly="True" ShowGroupPanel="False" FontSize="12" Height="400" VerticalAlignment="Top">
<telerikGridView:RadGridView.Columns>
<Telerik_Windows_Controls_GridView:GridViewDataColumn HeaderText="Sent Date" DataMemberBinding="{Binding Path=SentDate}" Width="110" DataFormatString="{}{0:d-MMM-yyyy}" />
<Telerik_Windows_Controls_GridView:GridViewDataColumn HeaderText="Details" DataMemberBinding="{Binding Path=Details}" Width="300"/>
<Telerik_Windows_Controls_GridView:GridViewDataColumn HeaderText="Sent To" DataMemberBinding="{Binding Path=ReceivingUser}" Width="240"/>
<Telerik_Windows_Controls_GridView:GridViewDataColumn HeaderText="Client" DataMemberBinding="{Binding Path=Client}" Width="160"/>
<Telerik_Windows_Controls_GridView:GridViewDataColumn HeaderText="ClientID" DataMemberBinding="{Binding Path=ClientID}" Width="110"/>
</telerikGridView:RadGridView.Columns>
</telerikGridView:RadGridView>
</Grid>
<Button Content="Close" Height="30" IsTabStop="True" x:Name="btnClose" FontFamily="Portable User Interface" Background="{x:Null}" BorderBrush="{x:Null}" Foreground="#FFFFFFFF" FontSize="14" Width="140" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Padding="0,0,0,0" HorizontalAlignment="Right" Margin="0,10,10,10" VerticalAlignment="Bottom"/>
</Grid>
</UserControl>
And my code-behind is pretty straightforward, but the close method does this:
void btnClose_Click(object sender, RoutedEventArgs e)
{
gridActivities.ItemsSource = null;
RadWindow window = RadWindow.GetParentRadWindow(this);
window.Hide();
}
The only difference between it and some others I've seem is that I am setting the ItemsSource to null (because the next time it is shown, I may pass in a new datacontext). When I press the close button, everything is OK. When I click the red X close (and I have CloseMode="Hide") I get the exception. As a workaround I set CloseMode="none" but that doesn't instill a lot of confidence that it won't crash some other way.
Any idea if this will be fixed in the Q12009 release (and any idea when its coming)?