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

GridView inside Canvas

1 Answer 30 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Gary
Top achievements
Rank 1
Gary asked on 07 Aug 2009, 05:16 PM
If a I create a simple form with just a RadGridView control:

<Grid>
        <telerik:RadGridView Name="radGridView1"/>
</Grid>

As I resize the window, the grid streches with the window and vertical/horizontal scrollbars appear if there's any extra rows/columns in the grid.  But if I change the container to a canvas:

<Canvas>
        <telerik:RadGridView Name="radGridView1"/>
</Canvas>

Then any overflow is hidden.  Even if I wrap the RadGridView in it's own grid under the canvas no scrollbars appear.  This seems to happen if there's a canvas element anywhere in the container hierarchy.  

1 Answer, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 10 Aug 2009, 03:53 PM
Hi Gary,

This is expected behavior because Canvas panel measure its children with Infinity size.
When measured with infinity scroll viewer will never show the scrollbars and RadGridView will not be able to virtualize its rows.
The recommended way is to put RadGridView in containers that don't measure it with infinity or you can set width and height explicitly on RadGridView.

Let us know if you need more information.

Sincerely yours,
Hristo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
GridView
Asked by
Gary
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Share this question
or