Hello.How to make the field fill the width of the container and not stretch to fit the text.Two pictures in the attachment.In the second image, the PropertyGrid extends outside the container.
answered on 12 Jan 2022, 11:19 AM
| edited on 12 Jan 2022, 11:22 AM
The issue has been resolved.
Loaded += LoadedHandler;
privatevoidLoadedHandler(object sender, RoutedEventArgs e)
{
var propertyGridPresenter = this.ChildrenOfType<PropertyGridPresenter>().FirstOrDefault();
var scrollViewer = propertyGridPresenter?.ChildrenOfType<ScrollViewer>().FirstOrDefault();
if (scrollViewer != null)
{
scrollViewer.HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled;
}
}
PS. But I think this it would be worth making it a separate property at the component level.
Stenly
Telerik team
commented on 14 Jan 2022, 10:09 AM
I am glad that you have found a working solution and that you took the time to share it. Also, thank you for the provided feedback. I will look into this and try to provide an answer to this question.
0
Stenly
Telerik team
answered on 14 Jan 2022, 01:28 PM
Hello Igor,
An alternative approach you could use, instead of subscribing to the Loaded event, would be to create a Style inside the RadPropertyGrid control instance's Resources collection, with ScrollViewer as TargetType. Then set its HorizontalScrollBarVisibility property to Disabled. In addition, for the string properties with long values, you could create an additional Style with TargetType="TextBox" and set its TextWrapping property to Wrap.
The following code snippet shows this approach's implementation:
With that said, could you give this approach a try?
Regards,
Stenly
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.