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

Grid resizes slowly on window resize

3 Answers 382 Views
GridView
This is a migrated thread and some comments may be shown as answers.
N Mackay
Top achievements
Rank 1
N Mackay asked on 21 May 2012, 10:18 AM
Hi,

I noticed an issue with GridView.

I bind 88 rows to a grid and when I maximise the window you get a black canvas and the grid overlayed by the same grid for a second or so before the grid resizes to the maximised window width.

I have attached a screenshot which shows this behaviour (the white areas were sensitive data cut, it's not a graphical issue).

The machine is a pretty new quad core 3Ghz machine with 8GB RAM and 512MB DDR2 ram graphic card running Win7 x64.

Visual Studio 2010 SP1, Rad Controls 20112.01.320.0. I tried with an older sample of RadGrid 2011.1.0419.40 and it had the same issue.

Is there a way to make the grid resize a little less clunky? am I missing something in the XAML?

Any feedback would be appreciated,

Thanks.

private void Window_Loaded(object sender, RoutedEventArgs e)
{
    // Instantiate the DataServiceContext.
    _context = new Vessel.Service.VesselService(_svcUri);
}
 
private void button_getvesselTypes_Click(object sender, RoutedEventArgs e)
{
    try
    {
 
        StartStats();
 
        var VTQuery = from v in _context.Vestype
                      select v;
 
        DataServiceCollection<VestypeEntity> VesselTypes = new
            DataServiceCollection<VestypeEntity>(VTQuery);
 
        this._radgrid_output.DataContext = VesselTypes;
 
        ShowStats();
    }
    catch (Exception ex)
    {
        MessageBox.Show(ex.ToString());
    }
}

<Window x:Class="TestClient.MainWindow"
        Title="WCF oData Test"
        Width="750" Height="600"
        x:Name="OutputWindow"
        Loaded="Window_Loaded">
     
    <Grid x:Name="grid_mainlayout">
        <Grid.RowDefinitions>
            <RowDefinition x:Name="gridrow_detailsection" Height="*"></RowDefinition>
            <RowDefinition x:Name="gridrow_footersection" Height="60"></RowDefinition>
        </Grid.RowDefinitions>
 
        <telerik:RadGridView  Name="_radgrid_output"
                              Grid.Row="0"
                              Margin="2"
                              HorizontalAlignment="Stretch"
                              VerticalAlignment="Stretch"
                              DataContext="{Binding}"
                              ItemsSource="{Binding}"
                              EnableColumnVirtualization="True"
                              EnableRowVirtualization="True"
                              DataLoadMode="Asynchronous"
                              IsReadOnly="True"
                              ActionOnLostFocus="None" />
         
        <StackPanel x:Name="stackpannel_buttons" Grid.Row="1" Orientation="Horizontal">
            <Button x:Name="button_Query1" Margin="2,10,10,10" Width="100" Content="Get 6000 rows" Click="button_getvessels_Click"></Button>
            <Button x:Name="button_Query2" Margin="2,10,10,10" Width="100" Content="Get 80 rows" Click="button_getvesselTypes_Click"></Button>
        </StackPanel>
    </Grid>
     
</Window>

3 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 24 May 2012, 11:07 AM
Hi,

 I have tested the described issue, but I was not able to encounter such a problem on window resize. The XAMLcode looks fine. What I can suggest is to set DataLoadMode to be Synchronous and check what the result is.

Regards,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
N Mackay
Top achievements
Rank 1
answered on 24 May 2012, 11:47 AM
Didie ,

Thanks for responding.

I tried that but I still get the same behaviour.

I'll try and get a sample together and open a ticket.

Thanks,
Norman.
0
N Mackay
Top achievements
Rank 1
answered on 24 May 2012, 12:10 PM
Didie,

It performs bit better if I switch of row and column virtualisation. The performace hit on the grid of massive when I do that though (when I bind 5000+ records I get an out of memory exception in the grid) so it's not a solution.
<telerik:RadGridView  Name="_radgrid_output"
                              Grid.Row="0"
                              Margin="2"
                              HorizontalAlignment="Stretch"
                              VerticalAlignment="Stretch"
                              DataContext="{Binding}"
                              ItemsSource="{Binding}"
                              EnableColumnVirtualization="False"
                              EnableRowVirtualization="False"
                              DataLoadMode="Asynchronous"
                              IsReadOnly="True"
                              ActionOnLostFocus="None" />
Tags
GridView
Asked by
N Mackay
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
N Mackay
Top achievements
Rank 1
Share this question
or