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

RadGridView and Grid

1 Answer 37 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Inger Marie
Top achievements
Rank 1
Inger Marie asked on 13 Mar 2014, 11:01 AM
Hi,

I saw this text on a Tips and Tricks page (http://www.telerik.com/help/silverlight/radgridview-performance-tips-tricks.html):

Try not to place RadGridView in controls/panels which will measure it with infinity. For example, ScrollViewer, StackPanel and Grid with Row.Height=Auto or Column.Width=Auto will measure with infinity. If RadGridView is measured with infinity the virtualization turns off. Also setting RadGridView.ColumnWidth to a specific width (like 100) will increase both horizontal & vertical scrolling performance. Auto is a little bit slower and Star is the slowest (most noticeable when you have a lot of columns).

What I normally do, is this:

<Grid>
  <Grid.RowDefinitions>
            <RowDefinition Height="Auto " />
            <RowDefinition Height="*" />
          <RowDefinition Height="Auto " />
          </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>

 
<Custom ToolBar Grid.Row="0" />
  <RadGridView Grid.Row="1"  />
 <StatusBar Grid.Row="2" />
</Grid>

But it seems that the tip-and-trick above tells me that this is a bad idea when it comes to performance.
But I am bit at a loss on what to do, then. I want the GridView how have only the available space. If I cannot use the stackpanel or grid, then how? Dockpanel?

I've googled a lot of answers to problems with infinity, but has been unable to spot a solution without Auto or Star.. Seems like everyone knows how to fix it without having it spelled out..  like me :-) ... Help will be appreciated!

1 Answer, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 17 Mar 2014, 05:41 PM
Hello,

You can set the GridView to be located in grid row measured with star instead of auto. This way the grid will not be measured with infinity and will take all available space.

Regards,
Hristo
Telerik
 

DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

 
Tags
GridView
Asked by
Inger Marie
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Share this question
or