I have a property grid and it shows a scroll bar when the text is to long. I want it to work like in visual studio where there is no huge ugly scroll bar at the buttom of the grid. I have tried changing the "Scroll Viewer" for the grid but it dosn't seem to do anything. It is in a dockable window so I can not just set the width of the text box as well.
7 Answers, 1 is accepted
0
Hello Alex,
You can set hard-coded Width value for both fields and RadPropertyGrid itself, like this:
Kind regards,
Ivan Ivanov
the Telerik team
You can set hard-coded Width value for both fields and RadPropertyGrid itself, like this:
<
Grid
>
<
Grid.Resources
>
<
Style
TargetType
=
"telerik:PropertyGridField"
>
<
Setter
Property
=
"Width"
Value
=
"400"
/>
</
Style
>
</
Grid.Resources
>
<
telerik:RadPropertyGrid
x:Name
=
"rpg"
Item
=
"{Binding Employee}"
Width
=
"402"
>
</
telerik:RadPropertyGrid
>
</
Grid
>
Kind regards,
Ivan Ivanov
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Alex
Top achievements
Rank 1
answered on 14 Jun 2012, 02:21 PM
I can't do that.
0
Hi,
Another option would be to subscribe to RadPropertyGrid's Loaded event and disable scrollviewer's horizontal scrolling like this:
Alternatively you may modify RadPropertyGrid's template setting HorizontalScrollBarVisibility there.
Kind regards,
Ivan Ivanov
the Telerik team
Another option would be to subscribe to RadPropertyGrid's Loaded event and disable scrollviewer's horizontal scrolling like this:
private void rpg_Loaded(object sender, RoutedEventArgs e)
{
(sender as RadPropertyGrid).ChildrenOfType<
ScrollViewer
>().First(sv => sv.Name == "PART_ItemsScrollViewer").HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled;
}
Kind regards,
Ivan Ivanov
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Alex
Top achievements
Rank 1
answered on 14 Jun 2012, 03:09 PM
Thank you that was what I needed.
0
Felix
Top achievements
Rank 1
answered on 11 Jul 2013, 01:42 PM
I can not find any ScrollViewer in the Control Template of the RPG. Your code (for the Loaded Event) throws an Exception.
I am using the most current Version/Hotfix of Q2.2013 from July, 8.
How to disable the horizontal Scrollbar with the current version?
Thanks
Felix
I am using the most current Version/Hotfix of Q2.2013 from July, 8.
How to disable the horizontal Scrollbar with the current version?
Thanks
Felix
0
Hello Felix,
I hope this does not cause much trouble on your side.
Regards,
Maya
Telerik
The thing is that we have made some improvement on introducing virtualization and this scroll viewer is not present. What you need to do now is to find the one in the PropertyGridPresenter:
private void propertyGrid_Loaded(object sender, RoutedEventArgs e)
{
var proeprtyGridPresenter = this.propertyGrid.ChildrenOfType<
PropertyGridPresenter
>().FirstOrDefault();
if (proeprtyGridPresenter != null)
{
var scrollViewer = proeprtyGridPresenter.ChildrenOfType<
ScrollViewer
>().FirstOrDefault();
if (scrollViewer != null)
{
scrollViewer.HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled;
}
}
}
I hope this does not cause much trouble on your side.
Regards,
Maya
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Felix
Top achievements
Rank 1
answered on 16 Jul 2013, 09:34 AM
Hello Maya,
this works great. Thank you!
Felix
this works great. Thank you!
Felix