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

Radgridview Resizing with window size

3 Answers 749 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Bhakti
Top achievements
Rank 1
Bhakti asked on 25 Jan 2012, 10:45 PM
We have a radwindow and user control in it.
As we resize the window size we are able to stretch radgridview widthwise...but on resize the height is not correct.
Meaning if the window is minimized to its height we want to radgridview to reduce in size and records with having a scrollbar for grideview. I.e it is should fit to the size of window.
Following is the code of the radexpander and radgridview used in the control.
Can you help us in this?

 

 

 

<telerik:RadExpander

 

 

 

x:Name="expOpenTicketsForTeam"

 

 

 

IsExpanded="True"

 

 

 

Header="Open Tickets for My Team"

 

 

 

HeaderTemplate="{StaticResource RadExpanderHeaderTemplate}"

 

 

 

>

 

 

 

 

<Grid>

 

 

 

 

<Grid.RowDefinitions>

 

 

 

 

<RowDefinition Height="Auto" />

 

 

 

 

</Grid.RowDefinitions>

 

 

 

 

<Grid.ColumnDefinitions>

 

 

 

 

<ColumnDefinition Width="*" />

 

 

 

 

</Grid.ColumnDefinitions>

 



 

 

 

<telerik:RadGridView

 

 

 

x:Name="gvOpenTicketsForTeam"

 

 

 

AutoGenerateColumns="False"

 

 

 

EnableRowVirtualization="True"

 

 

 

IsSynchronizedWithCurrentItem="False"

 

 

 

Background="Transparent"

 

 

 

SelectionMode="Single"

 

 

 

SelectionUnit="FullRow"

 

 

 

GridLinesVisibility="Horizontal"

 

 

 

ItemsSource="{Binding}"

 

 

 

IsReadOnly="True"

 

 

 

IsFilteringAllowed="True"

 

 

 

MinHeight="56"

 

 

 

Height="Auto"

 

 

 

MaxHeight="154"

 

 

 

ShowGroupPanel="False"

 

 

 

CanUserFreezeColumns="False"

 

 

 

CanUserResizeColumns="True"

 

 

 

RowIndicatorVisibility="Collapsed"

 

 

 

RowStyle="{StaticResource GridViewOpenTicketRowStyle}"

 

 

 

HorizontalAlignment="Stretch"

 

 

 

VerticalAlignment="Stretch"

 

 

 

ScrollViewer.HorizontalScrollBarVisibility="Disabled"

 

 

 

ScrollViewer.VerticalScrollBarVisibility="Auto"

 

 

 

MouseDoubleClick="gvOpenTicketsForTeam_MouseDoubleClick"

 

 

 

Width="{Binding RelativeSource={RelativeSource AncestorType={x:Type Grid}, AncestorLevel=1}, Path=ActualWidth}"

 

 

 

>

 

 

 

 

</telerik:RadGridView>

 

 

 

 

 

 

 

 

</Grid>

 

 

 

 

 

 

 

 

</telerik:RadExpander>

 

3 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 26 Jan 2012, 03:11 PM
Hello,

In order to get the RadGridView resizing appropriately you will need to place it inside a Grid with RowDefinition="*" and ColumnDefinition="*".

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

Does this works?

Greetings,
Didie
the Telerik team

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

0
Bhakti
Top achievements
Rank 1
answered on 26 Jan 2012, 03:55 PM
It is inside the grid with same properties.does not work :(
0
Dimitrina
Telerik team
answered on 26 Jan 2012, 04:31 PM
Hello,

 This would be strange, may you please confirm that you use the 2011.3.1220 version of the RadControls. Do you set the RowDefinition Height="*" for the code snippet that you have posted in your previous thread?

All the best,
Didie
the Telerik team

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

Tags
GridView
Asked by
Bhakti
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Bhakti
Top achievements
Rank 1
Share this question
or