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

Implicit style (visual studio 2013) + custom row style (MaxHeight) => results in empty GridView

2 Answers 74 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Erdem
Top achievements
Rank 1
Erdem asked on 26 Jun 2014, 12:21 PM

Hi,

I noticed some strange behaviour when using implicit styles and the using a custom style for a row in the gridivew... has anyone seen anything like this before..

... I have used this custom style before with success (as stated in the links below) ,... untill I start using implicit style (visual studio 2013)

http://www.telerik.com/forums/maxrowheight
http://www.telerik.com/forums/change-row-height


I made a sample project. If I remove the following piece of code from the gridview, everything works fine:

RowStyle="{StaticResource CustomRowStyle}"

If you want to check, you can download the sample project here:

https://drive.google.com/file/d/0B_OMCdXJPjZuVHg0WVczYWhiejg/edit?usp=sharing  (click File => Download)

Thanks !



2 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 27 Jun 2014, 07:20 AM
Hi,

When using Implicit Styles, you should define the Style like so: 
<Style x:Key="CustomRowStyle" TargetType="telerik:GridViewRowStyle">
    <Setter Property="MaxHeight" Value="200"/>
</Style>
 
Regards,
Didie
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Erdem
Top achievements
Rank 1
answered on 27 Jun 2014, 08:56 AM



thanks, this set me in the right direction.
Just to share the correct syntax with others:

<Style x:Key="CustomRowStyle" TargetType="telerik:GridViewRow" BasedOn="{StaticResource GridViewRowStyle}">
    <Setter Property="MaxHeight" Value="25"/>
</Style>

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