T
tshad
In WPF, if I use the Datagrid as:
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:my="http://schemas.microsoft.com/wpf/2008/toolkit"
WindowStartupLocation="CenterScreen"
FontFamily="Arial"
FontSize="14"
MinWidth="400"
SizeToContent="WidthAndHeight"
Loaded="Window_Loaded">
<Window.Resources>
<Style TargetType="WrapPanel">
<Setter Property="MaxWidth"
Value="500" />
</Style>
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" MinHeight="104" />
<RowDefinition Height="20" />
<RowDefinition Height="Auto" MinHeight="40" />
<RowDefinition Height="20" />
<RowDefinition Height="Auto" MinHeight="78" />
</Grid.RowDefinitions>
<WrapPanel Grid.Row="2">
<Label>Primary Key:</Label>
<TextBox Name="txtPK"></TextBox>
</WrapPanel>
<WrapPanel Grid.Row="4">
<my
ataGrid Height="200" Name="grdData" Width="469"
IsReadOnly="True" ItemsSource="{Binding}" />
</WrapPanel>
</Grid>
</Window>
This works fine
If I add in a couple of datagrid columns:
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:my="http://schemas.microsoft.com/wpf/2008/toolkit"
WindowStartupLocation="CenterScreen"
FontFamily="Arial"
FontSize="14"
MinWidth="400"
SizeToContent="WidthAndHeight"
Loaded="Window_Loaded">
<Window.Resources>
<Style TargetType="WrapPanel">
<Setter Property="MaxWidth"
Value="500" />
</Style>
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" MinHeight="104" />
<RowDefinition Height="20" />
<RowDefinition Height="Auto" MinHeight="40" />
<RowDefinition Height="20" />
<RowDefinition Height="Auto" MinHeight="78" />
</Grid.RowDefinitions>
<WrapPanel Grid.Row="2">
<Label>Primary Key:</Label>
<TextBox Name="txtPK"></TextBox>
</WrapPanel>
<WrapPanel Grid.Row="4">
<my
ataGrid Height="200" Name="grdData" Width="469"
IsReadOnly="True" ItemsSource="{Binding}">
<my
ataGrid.Columns>
<my
ataGridTextColumn
Binding="{Binding Path=EmployeeID}"
Header="EmployeeID" />
<my
ataGridTextColumn
Binding="{Binding Path=OrderDate}"
Header="OrderDate" />\
</my
ataGrid.Columns>
< /my
ataGrid>
</WrapPanel>
</Grid>
</Window>
The program goes into some processing loop that shows as 80%+ activity in
TaskManager.
The only way to stop it is to stop it from Task Manager. It will ask you if
you want to save the files but pushing the OK button does you no good.
It starts up OK then but with the old files in it.
My c# code is:
private void CollectionSample()
{
ProductManager mgr = new ProductManager();
try
{
grdData.ItemsSource = mgr.BuildCollection();
}
catch (Exception exc)
{
}
}
Is this a known bug?
Thanks,
Tom
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:my="http://schemas.microsoft.com/wpf/2008/toolkit"
WindowStartupLocation="CenterScreen"
FontFamily="Arial"
FontSize="14"
MinWidth="400"
SizeToContent="WidthAndHeight"
Loaded="Window_Loaded">
<Window.Resources>
<Style TargetType="WrapPanel">
<Setter Property="MaxWidth"
Value="500" />
</Style>
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" MinHeight="104" />
<RowDefinition Height="20" />
<RowDefinition Height="Auto" MinHeight="40" />
<RowDefinition Height="20" />
<RowDefinition Height="Auto" MinHeight="78" />
</Grid.RowDefinitions>
<WrapPanel Grid.Row="2">
<Label>Primary Key:</Label>
<TextBox Name="txtPK"></TextBox>
</WrapPanel>
<WrapPanel Grid.Row="4">
<my
![Big Grin :D :D](/styles/default/custom/smilies/grin.gif)
IsReadOnly="True" ItemsSource="{Binding}" />
</WrapPanel>
</Grid>
</Window>
This works fine
If I add in a couple of datagrid columns:
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:my="http://schemas.microsoft.com/wpf/2008/toolkit"
WindowStartupLocation="CenterScreen"
FontFamily="Arial"
FontSize="14"
MinWidth="400"
SizeToContent="WidthAndHeight"
Loaded="Window_Loaded">
<Window.Resources>
<Style TargetType="WrapPanel">
<Setter Property="MaxWidth"
Value="500" />
</Style>
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" MinHeight="104" />
<RowDefinition Height="20" />
<RowDefinition Height="Auto" MinHeight="40" />
<RowDefinition Height="20" />
<RowDefinition Height="Auto" MinHeight="78" />
</Grid.RowDefinitions>
<WrapPanel Grid.Row="2">
<Label>Primary Key:</Label>
<TextBox Name="txtPK"></TextBox>
</WrapPanel>
<WrapPanel Grid.Row="4">
<my
![Big Grin :D :D](/styles/default/custom/smilies/grin.gif)
IsReadOnly="True" ItemsSource="{Binding}">
<my
![Big Grin :D :D](/styles/default/custom/smilies/grin.gif)
<my
![Big Grin :D :D](/styles/default/custom/smilies/grin.gif)
Binding="{Binding Path=EmployeeID}"
Header="EmployeeID" />
<my
![Big Grin :D :D](/styles/default/custom/smilies/grin.gif)
Binding="{Binding Path=OrderDate}"
Header="OrderDate" />\
</my
![Big Grin :D :D](/styles/default/custom/smilies/grin.gif)
< /my
![Big Grin :D :D](/styles/default/custom/smilies/grin.gif)
</WrapPanel>
</Grid>
</Window>
The program goes into some processing loop that shows as 80%+ activity in
TaskManager.
The only way to stop it is to stop it from Task Manager. It will ask you if
you want to save the files but pushing the OK button does you no good.
It starts up OK then but with the old files in it.
My c# code is:
private void CollectionSample()
{
ProductManager mgr = new ProductManager();
try
{
grdData.ItemsSource = mgr.BuildCollection();
}
catch (Exception exc)
{
}
}
Is this a known bug?
Thanks,
Tom