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

[Solved] Problem with MaxHeight?

2 Answers 206 Views
Grid for XAML
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Yuri
Top achievements
Rank 1
Yuri asked on 02 Oct 2013, 04:18 PM

In the Windows Store 8.1 (Preview) XAML/C# project I've got a ListView whose items host RadDataGrid instances that may have varying heights (depending on the content), which I want to limit to a maximum value.

The problem seems to be that:

  • If I don't specify any Height restriction in the ListView definition, the items in the list are rendered with dynamic heights, as expected.
  • If I specify only the MinHeight (for ListView.ItemContainerStyle with TargetType="ListViewItem"), the items in the list are still rendered with dynamic heights, as expected, with the minimum height respected.
  • But if I specify the MaxHeight similarly, all the list items are rendered with the same fixed height.

The similar observations can be made if I apply the MaxHeight to the RadDataGrid template directly (and not set it for the ListItems).
Hence this appears to be a problem with Telerik RadDataGrid and not the .NET Framework ListView.

Now, if I set the MaxHeight on the Border object that is an immediate child of the RadDataGrid (I do that in run time using XAML Spy), everything seems to be working as expected: the RadDataGrid's height is resolved dynamically until it reaches the MaxHeight value, and then the vertical scrollbar appears.

Please confirm if this is a known issue, if it is planned to be resolved in the October release of Telerik Controls, and if there is a recommended workaround.

2 Answers, 1 is accepted

Sort by
0
Rosy Topchiyska
Telerik team
answered on 07 Oct 2013, 04:06 PM
Hi Yuri,

Thank you for contacting us.

The  VerticalAlignment of the RadDataGrid control by default is set to Stretch and this means the grid will take all the available space. If you set the VerticalAlignment to Top/Bottom the problem will be solved.

I hope this was useful. Do not hesitate to contact us should you have any other problems or suggestions.

Regards,
Rositsa Topchiyska
Telerik

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Yuri
Top achievements
Rank 1
answered on 07 Oct 2013, 05:11 PM
Thank you, this solves the problem indeed.
Tags
Grid for XAML
Asked by
Yuri
Top achievements
Rank 1
Answers by
Rosy Topchiyska
Telerik team
Yuri
Top achievements
Rank 1
Share this question
or