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

Disable RadPropertyGrid Horizontal Scrolling

5 Answers 317 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
Jonah
Top achievements
Rank 1
Jonah asked on 12 Feb 2014, 11:10 PM
I have several textboxes in my property grid that are sometimes larger than the grid, I don't want the grid to scroll horizontally. I added code in the loaded event to disable the scrollbar which works well. However when I click the category or A-Z button the scrollbar appears. I tried using the sorted and grouped method to disable the scrollbar but that doesn't seem to work. Any suggestions?

5 Answers, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 17 Feb 2014, 12:09 PM
Hi Jonah,

I would suggest you to use RadPropertyGrid with RenderMode="Flat". Then you can disable the horizontal scrollbar in the Loaded event like so:
private void RadPropertyGrid_Loaded(object sender, RoutedEventArgs e)
       {
           (sender as RadPropertyGrid).ChildrenOfType<VirtualizingStackPanel>().First().ScrollOwner.HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled;
       }

Please give it a try and let me know how it works for you.

Regards,
Yoan
Telerik

Check out the new Telerik Platform - the only modular platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native apps. Register for the free online keynote and webinar to learn more about the Platform on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT).

0
Jonah
Top achievements
Rank 1
answered on 17 Feb 2014, 10:07 PM
Thanks, that worked great!
0
Yoan
Telerik team
answered on 18 Feb 2014, 06:41 AM
Hi Jonah,

I am glad to hear that. Let me know if any additional questions arise.

Regards,
Yoan
Telerik

Check out the new Telerik Platform - the only modular platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native apps. Register for the free online keynote and webinar to learn more about the Platform on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT).

0
haochen
Top achievements
Rank 1
answered on 17 Jun 2015, 08:15 AM

Hi Yoan,

 

If I can't set RenderMode to 'Flat', How do I disable the horizontal scroll?

Because when I use tab to switch the focus it's not working when RenderMode is 'Flat'.

0
Yoan
Telerik team
answered on 18 Jun 2015, 02:38 PM
Hello,

Actually, you can disable the navigation which comes from the Flat mode. You can use the EnableBuiltInNavigation property of the PropertyGridCommandProvider. Please check the following code snippet for a reference:
public MainWindow()
        {
            InitializeComponent();
 
            this.RadPropertyGrid.CommandProvider = new CustomKeyboardCommandProvider(this.RadPropertyGrid);
        }
    }
 
    public class CustomKeyboardCommandProvider : PropertyGridCommandProvider
    {
        public CustomKeyboardCommandProvider()
            : base(null)
        {
 
        }
 
        public CustomKeyboardCommandProvider(RadPropertyGrid propertyGrid)
            : base(propertyGrid)
        {
            this.PropertyGrid = propertyGrid;
            this.EnableBuiltInNavigation = false;
        }
    }

I hope this will work for you.

Regards,
Yoan
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
PropertyGrid
Asked by
Jonah
Top achievements
Rank 1
Answers by
Yoan
Telerik team
Jonah
Top achievements
Rank 1
haochen
Top achievements
Rank 1
Share this question
or