Size single property grid?

7 posts, 0 answers
  1. Paolo
    Paolo avatar
    423 posts
    Member since:
    Jun 2009

    Posted 02 Aug 2011 Link to this post

    Hello,
    it's possible in some way to have a property that has an higher height? I've a complex object that compose the address of a customer, wish to have the possibility to show in a multiline then when clicking a button opening an edit window

    Thanks
    Paolo
  2. Ivan Ivanov
    Admin
    Ivan Ivanov avatar
    1127 posts

    Posted 03 Aug 2011 Link to this post

    Hello Paolo,

    In the current version of RadControls, the default style for PropertyGridField sets a fixed value to the Height property. Please, try setting an implicit style that sets the Height to "Auto", like this:

    <Style TargetType="telerik:PropertyGridField">
        <Setter Property="Height" Value="Auto" />
    </Style>
    Regards,
    Ivan Ivanov
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>
  3. DevCraft banner
  4. David
    David avatar
    9 posts
    Member since:
    Jul 2011

    Posted 16 Aug 2011 Link to this post

    I am trying this for what *seemed* like the simple scenario of a multi-line TextBox but I'm only getting the fixed height still. I've tried may combinations of EditorTemplates with/without scrollviewers, heights etc, but the Auto height does not seem to work for me.

    Can you please provide a simple example of an Editor Template that can support multiline (AccceptsReturn="True" etc) TextBox?

    Thanks!

    David,
  5. David
    David avatar
    9 posts
    Member since:
    Jul 2011

    Posted 16 Aug 2011 Link to this post

    Ah.. It seems that this works instead - use NaN instead of Auto. Is this the correct approach?
    <Style TargetType="telerik:PropertyGridField">
        <Setter Property="Height" Value="NaN" />
    </Style>
  6. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 16 Aug 2011 Link to this post

    Hello David,


    I am glad to hear that you found the most appropriate solution for your case. 
    As my colleague Ivan proposed you have to define a style targeted at PropertyGridField and set a Height, which is appropriate for your needs. Once you had a fixed height for this field you may set the AcceptsReturn property of the TextBox to True to get a multiline TextBox control. 



    Greetings,
    Vanya Pavlova
    the Telerik team

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

  7. Derek
    Derek avatar
    6 posts
    Member since:
    Sep 2007

    Posted 28 Aug 2011 Link to this post

    Hi Vanya

    Davids solution works great until I apply a Theme, at which point all the property sizes return to their default heights.  Is there a way to apply a theme and still maintain the custom property height?

    Thanks

    Derek
  8. Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 01 Sep 2011 Link to this post

    Hello Derek,


    It seems you are hitting a known limitation. Setting a theme other than the default tends to override the implicit styles. The workaround would be to set the property after applying the theme , e.g. in code behind.

    Best wishes,
    Pavel Pavlov
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Back to Top
DevCraft banner