This is a migrated thread and some comments may be shown as answers.

Blank rows after binding to RadGridView

3 Answers 303 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Sid
Top achievements
Rank 1
Sid asked on 04 Jan 2011, 07:22 PM

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:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             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>

3 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 05 Jan 2011, 08:10 AM
Hi,

 Can you post more info about the grid version?

Kind regards,
Vlad
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
0
Sid
Top achievements
Rank 1
answered on 09 Mar 2011, 08:16 PM
Apologies for the delay.  version is: 2010.1.309.35.
Just to clarify, I am getting alternating blank rows, i.e. 1 blank row and 1 row with data.  I am adding data to the DataTable using DataTable aRow = DataTable.NewRow();
<populate data into aRow>
DataTable.Rows.Add(aRow);
0
Vlad
Telerik team
answered on 10 Mar 2011, 08:16 AM
Hello,

 This is our Q1 2010. Can you try our latest official version (Q3 2010 SP1) instead? 

Regards,
Vlad
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
GridView
Asked by
Sid
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Sid
Top achievements
Rank 1
Share this question
or