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

3 posts, 0 answers
  1. Erdem
    Erdem avatar
    22 posts
    Member since:
    Sep 2013

    Posted 26 Jun 2014 Link to this post


    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. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 27 Jun 2014 Link to this post

    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.
     
  3. Erdem
    Erdem avatar
    22 posts
    Member since:
    Sep 2013

    Posted 27 Jun 2014 in reply to Dimitrina Link to this post




    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>

Back to Top