I have a Prism app which uses the BackGroundWorker for loading data into a DataTable and then binding the DataTable.DefaultView to the ItemSource of a RadGridView. Often when I start the application, I get blank rows added into the grid. Any idea why I get blank rows when I run the application sometimes but see actual data other times? See XAML below:
<
UserControl
x:Class
=
"OrganizationalUnitModule.Views.OUList"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
xmlns:my
=
"clr-namespace:OrganizationalUnitModule.Presenter"
xmlns:telerikData
=
"clr-namespace:Telerik.Windows.Data;assembly=Telerik.Windows.Data"
xmlns:telerikControls
=
"clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"
mc:Ignorable
=
"d"
d:DesignHeight
=
"300"
d:DesignWidth
=
"300"
>
<
UserControl.DataContext
>
<
my:OUListBWPresenter
/>
</
UserControl.DataContext
>
<
Grid
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"80"
/>
<
RowDefinition
Height
=
"40"
/>
<
RowDefinition
Height
=
"600"
/>
</
Grid.RowDefinitions
>
<
Border
Grid.Row
=
"0"
Margin
=
"0,0,0,0"
VerticalAlignment
=
"Top"
Height
=
"80"
Width
=
"Auto"
>
<
Border.Background
>
<
LinearGradientBrush
EndPoint
=
"0.5,1"
MappingMode
=
"RelativeToBoundingBox"
StartPoint
=
"0.5,0"
>
<
GradientStop
Color
=
"#FFEEF3EB"
Offset
=
"1"
/>
<
GradientStop
Color
=
"#FF0B72B4"
/>
<
GradientStop
Color
=
"#FF549BC5"
Offset
=
"0.323"
/>
<
GradientStop
Color
=
"#FFA4C9D8"
Offset
=
"0.677"
/>
</
LinearGradientBrush
>
</
Border.Background
>
</
Border
>
<
Border
Grid.Row
=
"1"
Margin
=
"0,0,0,0"
VerticalAlignment
=
"Top"
Height
=
"40"
Width
=
"Auto"
>
<
StackPanel
Orientation
=
"Horizontal"
>
<
telerikControls:RadButton
Content
=
"Mode"
Height
=
"30"
Width
=
"80"
Margin
=
"15,5,0,5"
/>
<
telerikControls:RadButton
Content
=
"Load"
Height
=
"30"
Width
=
"80"
Margin
=
"15,5,0,5"
Command
=
"{Binding LoadCommand}"
/>
<
telerikControls:RadButton
Content
=
"Cancel"
Height
=
"30"
Width
=
"80"
Margin
=
"15,5,0,5"
Command
=
"{Binding CancelCommand}"
/>
</
StackPanel
>
</
Border
>
<
Border
Grid.Row
=
"2"
Margin
=
"12,12,10,12"
>
<
telerik:RadGridView
x:Name
=
"OUGridView"
AutoGenerateColumns
=
"True"
ItemsSource
=
"{Binding Path=OrganizationalUnitsDT.DefaultView}"
IsBusy
=
"false"
Grid.Row
=
"2"
SelectionMode
=
"Multiple"
Margin
=
"0,0,0,0"
Height
=
"Auto"
Width
=
"Auto"
>
</
telerik:RadGridView
>
</
Border
>
</
Grid
>
</
UserControl
>