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

Size single property grid?

6 Answers 84 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
Michele
Top achievements
Rank 2
Michele asked on 02 Aug 2011, 03:25 PM
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

6 Answers, 1 is accepted

Sort by
0
Ivan Ivanov
Telerik team
answered on 03 Aug 2011, 08:23 AM
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 >>
0
David
Top achievements
Rank 1
answered on 16 Aug 2011, 06:40 AM
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,
0
David
Top achievements
Rank 1
answered on 16 Aug 2011, 07:55 AM
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>
0
Vanya Pavlova
Telerik team
answered on 16 Aug 2011, 08:32 AM
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 >>

0
Derek
Top achievements
Rank 1
answered on 28 Aug 2011, 03:58 PM
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
0
Pavel Pavlov
Telerik team
answered on 01 Sep 2011, 09:43 AM
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 >>

Tags
PropertyGrid
Asked by
Michele
Top achievements
Rank 2
Answers by
Ivan Ivanov
Telerik team
David
Top achievements
Rank 1
Vanya Pavlova
Telerik team
Derek
Top achievements
Rank 1
Pavel Pavlov
Telerik team
Share this question
or